aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml32
-rw-r--r--.gitignore3
-rw-r--r--.gitlab-ci.yml14
-rw-r--r--Documentation/.gitignore3
-rw-r--r--Documentation/CodingGuidelines22
-rw-r--r--Documentation/Makefile82
-rw-r--r--Documentation/RelNotes/2.40.4.txt5
-rw-r--r--Documentation/RelNotes/2.41.3.txt6
-rw-r--r--Documentation/RelNotes/2.42.4.txt6
-rw-r--r--Documentation/RelNotes/2.43.6.txt7
-rw-r--r--Documentation/RelNotes/2.44.3.txt7
-rw-r--r--Documentation/RelNotes/2.45.3.txt7
-rw-r--r--Documentation/RelNotes/2.46.3.txt6
-rw-r--r--Documentation/RelNotes/2.47.2.txt7
-rw-r--r--Documentation/RelNotes/2.48.0.txt137
-rw-r--r--Documentation/RelNotes/2.48.1.txt7
-rw-r--r--Documentation/RelNotes/2.49.0.txt97
-rw-r--r--Documentation/SubmittingPatches11
-rw-r--r--Documentation/asciidoc.conf.in (renamed from Documentation/asciidoc.conf)13
-rw-r--r--Documentation/asciidoctor-extensions.rb.in (renamed from Documentation/asciidoctor-extensions.rb)11
-rwxr-xr-xDocumentation/build-docdep.perl2
-rwxr-xr-xDocumentation/cmd-list.perl23
-rw-r--r--Documentation/config/commit.txt25
-rw-r--r--Documentation/config/credential.txt11
-rw-r--r--Documentation/config/diff.txt2
-rw-r--r--Documentation/config/difftool.txt2
-rw-r--r--Documentation/config/extensions.txt6
-rw-r--r--Documentation/config/merge.txt2
-rw-r--r--Documentation/config/remote.txt13
-rw-r--r--Documentation/config/worktree.txt10
-rwxr-xr-xDocumentation/generate-mergetool-list.sh17
-rw-r--r--Documentation/git-bundle.txt2
-rw-r--r--Documentation/git-clone.txt9
-rw-r--r--Documentation/git-commit.txt281
-rw-r--r--Documentation/git-credential-cache.txt17
-rw-r--r--Documentation/git-range-diff.txt17
-rw-r--r--Documentation/git-update-ref.txt8
-rw-r--r--Documentation/git-worktree.txt8
-rw-r--r--Documentation/git.txt32
-rw-r--r--Documentation/gitattributes.txt2
-rw-r--r--Documentation/gitcli.txt26
-rw-r--r--Documentation/gitcredentials.txt47
-rwxr-xr-xDocumentation/howto/howto-index.sh (renamed from Documentation/howto-index.sh)2
-rw-r--r--Documentation/howto/meson.build62
-rw-r--r--Documentation/i18n.txt4
-rw-r--r--Documentation/meson.build504
-rw-r--r--Documentation/rev-list-options.txt3
-rw-r--r--Documentation/signoff-option.txt8
-rwxr-xr-xDocumentation/technical/api-index.sh19
-rw-r--r--Documentation/technical/api-path-walk.txt63
-rw-r--r--Documentation/technical/build-systems.txt224
-rw-r--r--Documentation/technical/meson.build67
-rw-r--r--Documentation/user-manual.conf11
-rw-r--r--GIT-BUILD-OPTIONS.in48
-rw-r--r--GIT-VERSION-FILE.in1
-rwxr-xr-xGIT-VERSION-GEN108
-rw-r--r--Makefile278
l---------RelNotes2
-rw-r--r--add-interactive.c20
-rw-r--r--add-patch.c3
-rw-r--r--advice.c10
-rw-r--r--advice.h1
-rw-r--r--apply.c1
-rw-r--r--archive.c1
-rw-r--r--attr.c41
-rw-r--r--attr.h43
-rw-r--r--base85.c3
-rw-r--r--bin-wrappers/.gitignore9
-rw-r--r--bin-wrappers/meson.build28
-rwxr-xr-xbin-wrappers/wrap-for-bin.sh37
-rw-r--r--bisect.c12
-rw-r--r--blame.c1
-rw-r--r--bloom.c2
-rw-r--r--branch.c2
-rw-r--r--builtin/add.c9
-rw-r--r--builtin/am.c10
-rw-r--r--builtin/bisect.c2
-rw-r--r--builtin/blame.c24
-rw-r--r--builtin/branch.c19
-rw-r--r--builtin/bugreport.c2
-rw-r--r--builtin/bundle.c2
-rw-r--r--builtin/cat-file.c10
-rw-r--r--builtin/check-ref-format.c6
-rw-r--r--builtin/checkout--worker.c8
-rw-r--r--builtin/checkout-index.c9
-rw-r--r--builtin/checkout.c4
-rw-r--r--builtin/clean.c3
-rw-r--r--builtin/clone.c3
-rw-r--r--builtin/commit-graph.c1
-rw-r--r--builtin/commit-tree.c4
-rw-r--r--builtin/commit.c13
-rw-r--r--builtin/count-objects.c2
-rw-r--r--builtin/credential-cache--daemon.c4
-rw-r--r--builtin/credential.c9
-rw-r--r--builtin/describe.c18
-rw-r--r--builtin/diagnose.c4
-rw-r--r--builtin/diff-files.c6
-rw-r--r--builtin/diff-index.c5
-rw-r--r--builtin/diff-tree.c4
-rw-r--r--builtin/diff.c3
-rw-r--r--builtin/difftool.c5
-rw-r--r--builtin/fast-export.c3
-rw-r--r--builtin/fast-import.c28
-rw-r--r--builtin/fetch-pack.c4
-rw-r--r--builtin/fetch.c144
-rw-r--r--builtin/for-each-ref.c1
-rw-r--r--builtin/for-each-repo.c5
-rw-r--r--builtin/fsck.c32
-rw-r--r--builtin/fsmonitor--daemon.c6
-rw-r--r--builtin/gc.c21
-rw-r--r--builtin/get-tar-commit-id.c4
-rw-r--r--builtin/grep.c7
-rw-r--r--builtin/help.c10
-rw-r--r--builtin/index-pack.c169
-rw-r--r--builtin/log.c66
-rw-r--r--builtin/ls-files.c7
-rw-r--r--builtin/mailinfo.c2
-rw-r--r--builtin/mailsplit.c10
-rw-r--r--builtin/merge-base.c4
-rw-r--r--builtin/merge-file.c2
-rw-r--r--builtin/merge-index.c9
-rw-r--r--builtin/merge-ours.c5
-rw-r--r--builtin/merge-recursive.c6
-rw-r--r--builtin/merge-tree.c6
-rw-r--r--builtin/merge.c9
-rw-r--r--builtin/multi-pack-index.c6
-rw-r--r--builtin/mv.c2
-rw-r--r--builtin/name-rev.c2
-rw-r--r--builtin/pack-objects.c34
-rw-r--r--builtin/pack-redundant.c9
-rw-r--r--builtin/pack-refs.c1
-rw-r--r--builtin/patch-id.c16
-rw-r--r--builtin/prune.c5
-rw-r--r--builtin/pull.c4
-rw-r--r--builtin/push.c6
-rw-r--r--builtin/range-diff.c13
-rw-r--r--builtin/rebase.c9
-rw-r--r--builtin/receive-pack.c8
-rw-r--r--builtin/reflog.c1
-rw-r--r--builtin/remote-ext.c2
-rw-r--r--builtin/remote-fd.c1
-rw-r--r--builtin/remote.c87
-rw-r--r--builtin/repack.c8
-rw-r--r--builtin/replay.c4
-rw-r--r--builtin/rerere.c9
-rw-r--r--builtin/reset.c2
-rw-r--r--builtin/rev-list.c10
-rw-r--r--builtin/rev-parse.c5
-rw-r--r--builtin/revert.c1
-rw-r--r--builtin/rm.c3
-rw-r--r--builtin/send-pack.c2
-rw-r--r--builtin/shortlog.c1
-rw-r--r--builtin/show-branch.c2
-rw-r--r--builtin/show-index.c11
-rw-r--r--builtin/sparse-checkout.c2
-rw-r--r--builtin/stash.c7
-rw-r--r--builtin/submodule--helper.c8
-rw-r--r--builtin/tag.c17
-rw-r--r--builtin/unpack-file.c8
-rw-r--r--builtin/unpack-objects.c38
-rw-r--r--builtin/update-index.c7
-rw-r--r--builtin/update-ref.c2
-rw-r--r--builtin/update-server-info.c2
-rw-r--r--builtin/upload-archive.c6
-rw-r--r--builtin/upload-pack.c11
-rw-r--r--builtin/var.c8
-rw-r--r--builtin/verify-tag.c1
-rw-r--r--builtin/worktree.c39
-rw-r--r--bulk-checkin.c5
-rw-r--r--bundle-uri.c8
-rw-r--r--bundle.c44
-rw-r--r--bundle.h17
-rw-r--r--cache-tree.c1
-rw-r--r--chunk-format.c1
-rwxr-xr-xci/install-dependencies.sh26
-rwxr-xr-xci/lib.sh25
-rwxr-xr-xci/print-test-failures.sh2
-rwxr-xr-xci/run-build-and-minimal-fuzzers.sh13
-rwxr-xr-xci/run-build-and-tests.sh32
-rwxr-xr-xci/test-documentation.sh2
-rw-r--r--color.c2
-rw-r--r--column.c2
-rw-r--r--combine-diff.c1
-rw-r--r--commit-graph.c25
-rw-r--r--commit-reach.c74
-rw-r--r--commit-reach.h10
-rw-r--r--commit.c9
-rw-r--r--commit.h2
-rw-r--r--compat/bswap.h24
-rw-r--r--compat/fsmonitor/fsm-listen-darwin.c3
-rw-r--r--compat/mingw.c3
-rw-r--r--compat/poll/poll.c2
-rw-r--r--compat/regex/regex.c2
-rw-r--r--compat/terminal.c3
-rw-r--r--compat/win32/headless.c17
-rw-r--r--compat/win32mmap.c2
-rw-r--r--compat/winansi.c2
-rw-r--r--config.c23
-rw-r--r--config.mak.dev1
-rw-r--r--config.mak.uname4
-rw-r--r--configure.ac2
-rw-r--r--connect.c22
-rw-r--r--connected.c3
-rw-r--r--contrib/buildsystems/CMakeLists.txt310
-rw-r--r--contrib/buildsystems/git-version.in1
-rw-r--r--contrib/completion/git-completion.bash19
-rw-r--r--contrib/completion/meson.build16
-rw-r--r--contrib/meson.build3
-rw-r--r--contrib/subtree/.gitignore2
-rw-r--r--contrib/subtree/Makefile23
-rw-r--r--contrib/subtree/meson.build71
-rw-r--r--convert.c1
-rw-r--r--credential.c86
-rw-r--r--credential.h17
-rw-r--r--csum-file.c2
-rw-r--r--daemon.c37
-rw-r--r--date.c2
-rw-r--r--decorate.c3
-rw-r--r--delta-islands.c4
-rw-r--r--diagnose.c22
-rw-r--r--diagnose.h5
-rw-r--r--diff-delta.c2
-rw-r--r--diff-lib.c1
-rw-r--r--diff-no-index.c2
-rw-r--r--diff.c8
-rw-r--r--diff.h3
-rw-r--r--diffcore-order.c1
-rw-r--r--diffcore-pickaxe.c3
-rw-r--r--diffcore-rename.c4
-rw-r--r--diffcore-rotate.c1
-rw-r--r--dir.c1
-rw-r--r--entry.c8
-rw-r--r--environment.c3
-rw-r--r--environment.h1
-rw-r--r--ewah/ewah_bitmap.c5
-rw-r--r--ewah/ewah_io.c3
-rw-r--r--ewah/ewah_rlw.c3
-rw-r--r--fetch-pack.c27
-rw-r--r--fetch-pack.h11
-rw-r--r--fmt-merge-msg.c1
-rw-r--r--fsck.c4
-rw-r--r--fsmonitor.c1
-rwxr-xr-xgenerate-cmdlist.sh42
-rwxr-xr-xgenerate-configlist.sh20
-rwxr-xr-xgenerate-hooklist.sh15
-rwxr-xr-xgenerate-perl.sh37
-rwxr-xr-xgenerate-python.sh20
-rwxr-xr-xgenerate-script.sh34
-rw-r--r--gettext.c2
-rw-r--r--git-compat-util.h12
-rwxr-xr-xgit-cvsserver.perl2
-rwxr-xr-xgit-difftool--helper.sh8
-rwxr-xr-xgit-gui/git-gui.sh3
-rw-r--r--git-gui/lib/console.tcl2
-rw-r--r--git-gui/lib/diff.tcl26
-rw-r--r--git-gui/po/bg.po3191
-rwxr-xr-xgit-instaweb.sh12
-rw-r--r--git-mergetool--lib.sh12
-rwxr-xr-xgit-request-pull.sh2
-rwxr-xr-xgit-send-email.perl2
-rw-r--r--git-sh-i18n.sh6
-rw-r--r--git-sh-setup.sh6
-rwxr-xr-xgit-submodule.sh216
-rwxr-xr-xgit-svn.perl2
-rw-r--r--git.c42
-rw-r--r--git.rc.in (renamed from git.rc)6
-rwxr-xr-xgitk-git/gitk86
-rw-r--r--gitk-git/po/bg.po730
-rw-r--r--gitk-git/po/sv.po734
-rw-r--r--gitweb/GITWEB-BUILD-OPTIONS.in24
-rw-r--r--gitweb/Makefile62
-rwxr-xr-xgitweb/generate-gitweb-cgi.sh47
-rwxr-xr-xgitweb/generate-gitweb-js.sh12
-rwxr-xr-xgitweb/gitweb.perl46
-rw-r--r--gitweb/meson.build89
-rw-r--r--gpg-interface.c14
-rw-r--r--graph.c4
-rw-r--r--grep.c2
-rw-r--r--help.c1
-rw-r--r--help.h8
-rw-r--r--hex.c6
-rw-r--r--hook.c2
-rw-r--r--http-backend.c1
-rw-r--r--http-push.c3
-rw-r--r--http-walker.c1
-rw-r--r--http.c29
-rw-r--r--imap-send.c11
-rw-r--r--json-writer.c2
-rw-r--r--kwset.c2
-rw-r--r--line-log.c2
-rw-r--r--list-objects-filter-options.c4
-rw-r--r--list-objects.c14
-rw-r--r--log-tree.c3
-rw-r--r--ls-refs.c4
-rw-r--r--mailinfo.c6
-rw-r--r--mailinfo.h4
-rw-r--r--mailmap.c1
-rw-r--r--match-trees.c51
-rw-r--r--mem-pool.c2
-rw-r--r--merge-ll.c1
-rw-r--r--merge-ort.c1
-rw-r--r--merge-recursive.c1
-rw-r--r--merge.c4
-rw-r--r--meson.build1955
-rw-r--r--meson_options.txt99
-rw-r--r--midx-write.c141
-rw-r--r--midx.c102
-rw-r--r--midx.h27
-rw-r--r--name-hash.c1
-rw-r--r--negotiator/skipping.c5
-rw-r--r--notes-merge.c1
-rw-r--r--notes.c1
-rw-r--r--object-file-convert.c1
-rw-r--r--object-file.c67
-rw-r--r--object-name.c106
-rw-r--r--object-store-ll.h9
-rw-r--r--object.c1
-rw-r--r--oss-fuzz/.gitignore3
-rw-r--r--oss-fuzz/fuzz-credential-from-url-gently.c32
-rw-r--r--oss-fuzz/fuzz-parse-attr-line.c41
-rw-r--r--oss-fuzz/fuzz-url-decode-mem.c43
-rw-r--r--pack-bitmap-write.c7
-rw-r--r--pack-bitmap.c141
-rw-r--r--pack-check.c1
-rw-r--r--pack-objects.h3
-rw-r--r--pack-revindex.c2
-rw-r--r--pack-write.c1
-rw-r--r--pack.h5
-rw-r--r--packfile.c165
-rw-r--r--packfile.h24
-rw-r--r--pager.c14
-rw-r--r--pager.h7
-rw-r--r--parallel-checkout.c1
-rw-r--r--parse-options.c53
-rw-r--r--parse-options.h16
-rw-r--r--path-walk.c591
-rw-r--r--path-walk.h69
-rw-r--r--path.c14
-rw-r--r--path.h17
-rw-r--r--pathspec.c1
-rw-r--r--perl/FromCPAN/Mail/meson.build8
-rw-r--r--perl/FromCPAN/meson.build10
-rw-r--r--perl/Git/I18N.pm6
-rw-r--r--perl/Git/LoadCPAN.pm6
-rw-r--r--perl/Git/LoadCPAN/Mail/meson.build8
-rw-r--r--perl/Git/LoadCPAN/meson.build10
-rw-r--r--perl/Git/SVN/Memoize/meson.build8
-rw-r--r--perl/Git/SVN/meson.build21
-rw-r--r--perl/Git/meson.build19
-rw-r--r--perl/header_templates/fixed_prefix.template.pl2
-rw-r--r--perl/header_templates/runtime_prefix.template.pl8
-rw-r--r--perl/meson.build13
-rw-r--r--pkt-line.c23
-rw-r--r--po/bg.po357
-rw-r--r--po/de.po304
-rw-r--r--po/fr.po785
-rw-r--r--po/id.po338
-rw-r--r--po/meson.build27
-rw-r--r--po/sv.po413
-rw-r--r--po/tr.po293
-rw-r--r--po/uk.po599
-rw-r--r--po/vi.po336
-rw-r--r--po/zh_CN.po301
-rw-r--r--po/zh_TW.po667
-rw-r--r--preload-index.c5
-rw-r--r--pretty.c1
-rw-r--r--prio-queue.c15
-rw-r--r--prio-queue.h6
-rw-r--r--progress.c35
-rw-r--r--progress.h13
-rw-r--r--promisor-remote.c2
-rw-r--r--prune-packed.c5
-rw-r--r--pseudo-merge.c4
-rw-r--r--quote.c2
-rw-r--r--range-diff.c16
-rw-r--r--range-diff.h1
-rw-r--r--reachable.c4
-rw-r--r--read-cache.c8
-rw-r--r--ref-filter.c120
-rw-r--r--ref-filter.h13
-rw-r--r--reflog.c1
-rw-r--r--refs.c95
-rw-r--r--refs.h48
-rw-r--r--refs/debug.c3
-rw-r--r--refs/files-backend.c35
-rw-r--r--refs/iterator.c2
-rw-r--r--refs/packed-backend.c1
-rw-r--r--refs/refs-internal.h5
-rw-r--r--refs/reftable-backend.c438
-rw-r--r--refspec.c1
-rw-r--r--reftable/basics.c42
-rw-r--r--reftable/basics.h53
-rw-r--r--reftable/block.c30
-rw-r--r--reftable/block.h14
-rw-r--r--reftable/blocksource.c8
-rw-r--r--reftable/merged.c18
-rw-r--r--reftable/merged.h3
-rw-r--r--reftable/pq.c2
-rw-r--r--reftable/reader.c46
-rw-r--r--reftable/reader.h10
-rw-r--r--reftable/record.c137
-rw-r--r--reftable/record.h25
-rw-r--r--reftable/reftable-basics.h13
-rw-r--r--reftable/reftable-blocksource.h13
-rw-r--r--reftable/reftable-merged.h4
-rw-r--r--reftable/reftable-reader.h2
-rw-r--r--reftable/reftable-record.h16
-rw-r--r--reftable/reftable-stack.h3
-rw-r--r--reftable/reftable-writer.h19
-rw-r--r--reftable/stack.c231
-rw-r--r--reftable/system.c126
-rw-r--r--reftable/system.h89
-rw-r--r--reftable/writer.c32
-rw-r--r--remote-curl.c5
-rw-r--r--remote.c27
-rw-r--r--remote.h10
-rw-r--r--repo-settings.c18
-rw-r--r--repo-settings.h7
-rw-r--r--repository.c1
-rw-r--r--repository.h1
-rw-r--r--rerere.c1
-rw-r--r--resolve-undo.c15
-rw-r--r--resolve-undo.h6
-rw-r--r--revision.c14
-rw-r--r--run-command.c1
-rw-r--r--scalar.c6
-rw-r--r--send-pack.c82
-rw-r--r--send-pack.h3
-rw-r--r--sequencer.c1
-rw-r--r--serve.c43
-rw-r--r--serve.h6
-rw-r--r--server-info.c41
-rw-r--r--server-info.h4
-rw-r--r--setup.c40
-rw-r--r--setup.h1
-rw-r--r--shallow.c39
-rw-r--r--shallow.h6
-rw-r--r--shared.mak11
-rw-r--r--sideband.c1
-rw-r--r--sparse-index.c1
-rw-r--r--split-index.c1
-rw-r--r--strbuf.c6
-rw-r--r--strbuf.h23
-rw-r--r--string-list.c2
-rw-r--r--strvec.c14
-rw-r--r--submodule-config.c1
-rw-r--r--submodule.c11
-rw-r--r--subprojects/.gitignore1
-rw-r--r--subprojects/curl.wrap13
-rw-r--r--subprojects/expat.wrap13
-rw-r--r--subprojects/openssl.wrap15
-rw-r--r--subprojects/pcre2.wrap16
-rw-r--r--subprojects/zlib.wrap13
-rw-r--r--symlinks.c2
-rw-r--r--t/.gitignore1
-rw-r--r--t/Makefile20
-rw-r--r--t/helper/meson.build92
-rw-r--r--t/helper/test-bloom.c9
-rw-r--r--t/helper/test-cache-tree.c1
-rw-r--r--t/helper/test-config.c1
-rw-r--r--t/helper/test-csprng.c5
-rw-r--r--t/helper/test-drop-caches.c2
-rw-r--r--t/helper/test-dump-fsmonitor.c3
-rw-r--r--t/helper/test-dump-split-index.c3
-rw-r--r--t/helper/test-dump-untracked-cache.c6
-rw-r--r--t/helper/test-genrandom.c2
-rw-r--r--t/helper/test-genzeros.c2
-rw-r--r--t/helper/test-hash-speed.c5
-rw-r--r--t/helper/test-mergesort.c2
-rw-r--r--t/helper/test-parse-options.c5
-rw-r--r--t/helper/test-path-utils.c1
-rw-r--r--t/helper/test-path-walk.c112
-rw-r--r--t/helper/test-progress.c6
-rw-r--r--t/helper/test-reach.c9
-rw-r--r--t/helper/test-read-midx.c8
-rw-r--r--t/helper/test-ref-store.c3
-rw-r--r--t/helper/test-reftable.c4
-rw-r--r--t/helper/test-run-command.c2
-rw-r--r--t/helper/test-serve-v2.c7
-rw-r--r--t/helper/test-simple-ipc.c4
-rw-r--r--t/helper/test-string-list.c2
-rw-r--r--t/helper/test-tool.c4
-rw-r--r--t/helper/test-tool.h1
-rw-r--r--t/helper/test-trace2.c1
-rw-r--r--t/lib-credential.sh15
-rw-r--r--t/lib-gettext.sh4
-rw-r--r--t/lib-gitweb.sh5
-rw-r--r--t/meson.build1151
-rwxr-xr-xt/perf/p6100-describe.sh30
-rwxr-xr-xt/t0001-init.sh22
-rwxr-xr-xt/t0012-help.sh3
-rwxr-xr-xt/t0018-advice.sh2
-rwxr-xr-xt/t0210-trace2-normal.sh9
-rwxr-xr-xt/t0300-credentials.sh49
-rwxr-xr-xt/t0411-clone-from-partial.sh3
-rwxr-xr-xt/t1006-cat-file.sh31
-rwxr-xr-xt/t1400-update-ref.sh9
-rwxr-xr-xt/t1500-rev-parse.sh15
-rwxr-xr-xt/t2400-worktree-add.sh46
-rwxr-xr-xt/t2401-worktree-prune.sh3
-rwxr-xr-xt/t2402-worktree-list.sh22
-rwxr-xr-xt/t2403-worktree-move.sh25
-rwxr-xr-xt/t2406-worktree-repair.sh39
-rwxr-xr-xt/t2408-worktree-relative.sh38
-rwxr-xr-xt/t3200-branch.sh2
-rwxr-xr-xt/t3203-branch-output.sh28
-rwxr-xr-xt/t3206-range-diff.sh16
-rwxr-xr-xt/t3404-rebase-interactive.sh6
-rwxr-xr-xt/t3501-revert-cherry-pick.sh2
-rwxr-xr-xt/t3507-cherry-pick-conflict.sh6
-rwxr-xr-xt/t3510-cherry-pick-sequence.sh2
-rwxr-xr-xt/t3511-cherry-pick-x.sh2
-rwxr-xr-xt/t3602-rm-sparse-checkout.sh2
-rwxr-xr-xt/t3700-add.sh6
-rwxr-xr-xt/t3705-add-sparse-checkout.sh2
-rwxr-xr-xt/t4069-remerge-diff.sh7
-rwxr-xr-xt/t4207-log-decoration-colors.sh3
-rwxr-xr-xt/t5300-pack-object.sh18
-rwxr-xr-xt/t5504-fetch-receive-strict.sh16
-rwxr-xr-xt/t5505-remote.sh118
-rwxr-xr-xt/t5510-fetch.sh179
-rwxr-xr-xt/t5512-ls-remote.sh2
-rwxr-xr-xt/t5514-fetch-multiple.sh17
-rwxr-xr-xt/t5516-fetch-push.sh3
-rwxr-xr-xt/t5527-fetch-odd-refs.sh3
-rwxr-xr-xt/t5541-http-push-smart.sh6
-rwxr-xr-xt/t5550-http-fetch-dumb.sh14
-rwxr-xr-xt/t5551-http-fetch-smart.sh16
-rwxr-xr-xt/t5604-clone-reference.sh6
-rwxr-xr-xt/t5605-clone-local.sh10
-rwxr-xr-xt/t5607-clone-bundle.sh7
-rwxr-xr-xt/t6020-bundle-misc.sh44
-rwxr-xr-xt/t6120-describe.sh48
-rwxr-xr-xt/t6600-test-reach.sh29
-rwxr-xr-xt/t6601-path-walk.sh368
-rwxr-xr-xt/t7002-mv-sparse-checkout.sh4
-rwxr-xr-xt/t7004-tag.sh14
-rwxr-xr-xt/t7110-reset-merge.sh12
-rwxr-xr-xt/t7201-co.sh4
-rwxr-xr-xt/t7400-submodule-basic.sh2
-rwxr-xr-xt/t7407-submodule-foreach.sh4
-rwxr-xr-xt/t7508-status.sh2
-rwxr-xr-xt/t7600-merge.sh2
-rwxr-xr-xt/t7609-mergetool--lib.sh2
-rwxr-xr-xt/t7610-mergetool.sh8
-rwxr-xr-xt/t7611-merge-abort.sh34
-rwxr-xr-xt/t7900-maintenance.sh3
-rwxr-xr-xt/t8002-blame.sh26
-rwxr-xr-xt/t9210-scalar.sh5
-rwxr-xr-xt/t9211-scalar-clone.sh6
-rwxr-xr-xt/t9300-fast-import.sh113
-rwxr-xr-xt/t9350-fast-export.sh2
-rwxr-xr-xt/t9835-git-p4-metadata-encoding-python2.sh50
-rwxr-xr-xt/t9836-git-p4-metadata-encoding-python3.sh50
-rwxr-xr-xt/t9902-completion.sh65
-rw-r--r--t/test-lib-functions.sh12
-rw-r--r--t/test-lib.sh61
-rwxr-xr-xt/unit-tests/generate-clar-decls.sh6
-rw-r--r--t/unit-tests/lib-reftable.c7
-rw-r--r--t/unit-tests/lib-reftable.h2
-rw-r--r--t/unit-tests/t-example-decorate.c4
-rw-r--r--t/unit-tests/t-mem-pool.c31
-rw-r--r--t/unit-tests/t-prio-queue.c91
-rw-r--r--t/unit-tests/t-reftable-basics.c58
-rw-r--r--t/unit-tests/t-reftable-block.c41
-rw-r--r--t/unit-tests/t-reftable-merged.c103
-rw-r--r--t/unit-tests/t-reftable-pq.c3
-rw-r--r--t/unit-tests/t-reftable-reader.c4
-rw-r--r--t/unit-tests/t-reftable-readwrite.c51
-rw-r--r--t/unit-tests/t-reftable-record.c76
-rw-r--r--t/unit-tests/t-reftable-stack.c39
-rw-r--r--t/unit-tests/t-trailer.c2
-rw-r--r--t/unit-tests/test-lib.c2
-rw-r--r--t/unit-tests/u-ctype.c (renamed from t/unit-tests/ctype.c)0
-rw-r--r--t/unit-tests/u-hash.c (renamed from t/unit-tests/t-hash.c)71
-rw-r--r--t/unit-tests/u-mem-pool.c25
-rw-r--r--t/unit-tests/u-prio-queue.c94
-rw-r--r--t/unit-tests/u-reftable-tree.c (renamed from t/unit-tests/t-reftable-tree.c)30
-rw-r--r--t/unit-tests/u-strvec.c (renamed from t/unit-tests/strvec.c)10
-rw-r--r--t/unit-tests/unit-test.c19
-rw-r--r--tag.c3
-rw-r--r--templates/Makefile39
-rw-r--r--templates/branches--1
-rw-r--r--templates/description (renamed from templates/this--description)0
-rwxr-xr-xtemplates/hooks/applypatch-msg.sample (renamed from templates/hooks--applypatch-msg.sample)0
-rwxr-xr-xtemplates/hooks/commit-msg.sample (renamed from templates/hooks--commit-msg.sample)0
-rwxr-xr-xtemplates/hooks/fsmonitor-watchman.sample (renamed from templates/hooks--fsmonitor-watchman.sample)0
-rw-r--r--templates/hooks/meson.build26
-rwxr-xr-xtemplates/hooks/post-update.sample (renamed from templates/hooks--post-update.sample)0
-rwxr-xr-xtemplates/hooks/pre-applypatch.sample (renamed from templates/hooks--pre-applypatch.sample)0
-rwxr-xr-xtemplates/hooks/pre-commit.sample (renamed from templates/hooks--pre-commit.sample)0
-rwxr-xr-xtemplates/hooks/pre-merge-commit.sample (renamed from templates/hooks--pre-merge-commit.sample)0
-rwxr-xr-xtemplates/hooks/pre-push.sample (renamed from templates/hooks--pre-push.sample)0
-rwxr-xr-xtemplates/hooks/pre-rebase.sample (renamed from templates/hooks--pre-rebase.sample)0
-rwxr-xr-xtemplates/hooks/pre-receive.sample (renamed from templates/hooks--pre-receive.sample)0
-rwxr-xr-xtemplates/hooks/prepare-commit-msg.sample (renamed from templates/hooks--prepare-commit-msg.sample)0
-rwxr-xr-xtemplates/hooks/push-to-checkout.sample (renamed from templates/hooks--push-to-checkout.sample)0
-rwxr-xr-xtemplates/hooks/sendemail-validate.sample (renamed from templates/hooks--sendemail-validate.sample)0
-rwxr-xr-xtemplates/hooks/update.sample (renamed from templates/hooks--update.sample)0
-rw-r--r--templates/info/exclude (renamed from templates/info--exclude)0
-rw-r--r--templates/info/meson.build7
-rw-r--r--templates/meson.build15
-rw-r--r--tmp-objdir.c18
-rw-r--r--tmp-objdir.h5
-rw-r--r--trace.c10
-rw-r--r--trace.h4
-rw-r--r--trace2.c4
-rw-r--r--trace2/tr2_sysenv.c2
-rw-r--r--trace2/tr2_tgt_event.c5
-rw-r--r--trace2/tr2_tgt_normal.c5
-rw-r--r--trace2/tr2_tgt_perf.c7
-rw-r--r--trailer.c3
-rw-r--r--transport-helper.c13
-rw-r--r--transport.c41
-rw-r--r--tree-diff.c1
-rw-r--r--unimplemented.sh2
-rw-r--r--unix-socket.c2
-rw-r--r--unpack-trees.c5
-rw-r--r--upload-pack.c1
-rw-r--r--urlmatch.c2
-rw-r--r--usage.c30
-rw-r--r--userdiff.c1
-rw-r--r--utf8.c2
-rw-r--r--version-def.h.in8
-rw-r--r--version.c9
-rw-r--r--versioncmp.c3
-rw-r--r--walker.c3
-rw-r--r--worktree.c158
-rw-r--r--worktree.h22
-rw-r--r--wrap-for-bin.sh36
-rw-r--r--wrapper.c27
-rw-r--r--wrapper.h16
-rw-r--r--ws.c3
-rw-r--r--wt-status.c1
-rw-r--r--xdiff-interface.c1
-rw-r--r--xdiff/xdiffi.c1
-rw-r--r--xdiff/xinclude.h2
637 files changed, 18725 insertions, 7264 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9301a1edd6..900be9957a 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -113,15 +113,13 @@ jobs:
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- uses: actions/checkout@v4
- - name: setup SDK
- shell: powershell
- run: ci/install-sdk.ps1
+ - uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: build
- shell: powershell
+ shell: bash
env:
HOME: ${{runner.workspace}}
NO_PERL: 1
- run: git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
+ run: . /etc/profile && ci/make-test-artifacts.sh artifacts
- name: zip up tracked files
run: git archive -o artifacts/tracked.tar.gz HEAD
- name: upload tracked files and build artifacts
@@ -149,12 +147,10 @@ jobs:
- name: extract tracked files and build artifacts
shell: bash
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
- - name: setup SDK
- shell: powershell
- run: ci/install-sdk.ps1
+ - uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: test
- shell: powershell
- run: git-sdk/usr/bin/bash.exe -l -c 'ci/run-test-slice.sh ${{matrix.nr}} 10'
+ shell: bash
+ run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
shell: bash
@@ -286,6 +282,9 @@ jobs:
- jobname: osx-gcc
cc: gcc-13
pool: macos-13
+ - jobname: osx-meson
+ cc: clang
+ pool: macos-13
- jobname: linux-gcc-default
cc: gcc
pool: ubuntu-latest
@@ -298,11 +297,15 @@ jobs:
- jobname: linux-asan-ubsan
cc: clang
pool: ubuntu-latest
+ - jobname: linux-meson
+ cc: gcc
+ pool: ubuntu-latest
env:
CC: ${{matrix.vector.cc}}
CC_PACKAGE: ${{matrix.vector.cc_package}}
jobname: ${{matrix.vector.jobname}}
distro: ${{matrix.vector.pool}}
+ TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t
runs-on: ${{matrix.vector.pool}}
steps:
- uses: actions/checkout@v4
@@ -342,12 +345,21 @@ jobs:
- jobname: linux-musl
image: alpine
distro: alpine-latest
+ # Supported until 2025-04-02.
- jobname: linux32
image: i386/ubuntu:focal
distro: ubuntu32-20.04
- jobname: pedantic
image: fedora
distro: fedora-latest
+ # A RHEL 8 compatible distro. Supported until 2029-05-31.
+ - jobname: almalinux-8
+ image: almalinux:8
+ distro: almalinux-8
+ # Supported until 2026-08-31.
+ - jobname: debian-11
+ image: debian:11
+ distro: debian-11
env:
jobname: ${{matrix.vector.jobname}}
distro: ${{matrix.vector.distro}}
diff --git a/.gitignore b/.gitignore
index 6687bd6db4..e82aa19df0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,6 @@
/GIT-TEST-SUITES
/GIT-USER-AGENT
/GIT-VERSION-FILE
-/bin-wrappers/
/git
/git-add
/git-am
@@ -195,9 +194,11 @@
/config-list.h
/command-list.h
/hook-list.h
+/version-def.h
*.tar.gz
*.dsc
*.deb
+/git.rc
/git.spec
*.exe
*.[aos]
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 526ecfe030..9254e01583 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,6 +20,7 @@ test:linux:
- saas-linux-medium-amd64
variables:
CUSTOM_PATH: "/custom"
+ TEST_OUTPUT_DIRECTORY: "/tmp/test-output"
before_script:
- ./ci/install-dependencies.sh
script:
@@ -31,11 +32,12 @@ test:linux:
if test "$CI_JOB_STATUS" != 'success'
then
sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
+ mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
fi
parallel:
matrix:
- jobname: linux-old
- image: ubuntu:16.04
+ image: ubuntu:20.04
CC: gcc
- jobname: linux-sha256
image: ubuntu:latest
@@ -67,6 +69,9 @@ test:linux:
image: fedora:latest
- jobname: linux-musl
image: alpine:latest
+ - jobname: linux-meson
+ image: ubuntu:latest
+ CC: gcc
artifacts:
paths:
- t/failed-test-artifacts
@@ -99,10 +104,13 @@ test:osx:
parallel:
matrix:
- jobname: osx-clang
- image: macos-13-xcode-14
+ image: macos-14-xcode-15
CC: clang
- jobname: osx-reftable
- image: macos-13-xcode-14
+ image: macos-14-xcode-15
+ CC: clang
+ - jobname: osx-meson
+ image: macos-14-xcode-15
CC: clang
artifacts:
paths:
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index a48448de32..9f4bb3c4bf 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -12,6 +12,9 @@ cmds-*.txt
mergetools-*.txt
SubmittingPatches.txt
tmp-doc-diff/
+tmp-meson-diff/
GIT-ASCIIDOCFLAGS
/.build/
/GIT-EXCLUDED-PROGRAMS
+/asciidoc.conf
+/asciidoctor-extensions.rb
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 87904791cb..ba047ed224 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -583,7 +583,7 @@ For C programs:
Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
- ./bin-wrappers/git log` (See `wrap-for-bin.sh`.)
+ ./bin-wrappers/git log` (See `bin-wrappers/wrap-for-bin.sh`.)
- The primary data structure that a subsystem 'S' deals with is called
`struct S`. Functions that operate on `struct S` are named
@@ -703,16 +703,30 @@ Program Output
Error Messages
- - Do not end error messages with a full stop.
+ - Do not end a single-sentence error message with a full stop.
- Do not capitalize the first word, only because it is the first word
- in the message ("unable to open %s", not "Unable to open %s"). But
+ in the message ("unable to open '%s'", not "Unable to open '%s'"). But
"SHA-3 not supported" is fine, because the reason the first word is
capitalized is not because it is at the beginning of the sentence,
but because the word would be spelled in capital letters even when
it appeared in the middle of the sentence.
- - Say what the error is first ("cannot open %s", not "%s: cannot open")
+ - Say what the error is first ("cannot open '%s'", not "%s: cannot open").
+
+ - Enclose the subject of an error inside a pair of single quotes,
+ e.g. `die(_("unable to open '%s'"), path)`.
+
+ - Unless there is a compelling reason not to, error messages from
+ porcelain commands should be marked for translation, e.g.
+ `die(_("bad revision %s"), revision)`.
+
+ - Error messages from the plumbing commands are sometimes meant for
+ machine consumption and should not be marked for translation,
+ e.g., `die("bad revision %s", revision)`.
+
+ - BUG("message") are for communicating the specific error to developers,
+ thus should not be translated.
Externally Visible Names
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 0f55baa252..aedfe99d1d 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,6 +1,8 @@
# Import tree-wide shared Makefile behavior and libraries
include ../shared.mak
+.PHONY: FORCE
+
# Guard against environment variables
MAN1_TXT =
MAN5_TXT =
@@ -111,6 +113,7 @@ TECH_DOCS += MyFirstObjectWalk
TECH_DOCS += SubmittingPatches
TECH_DOCS += ToolsForGit
TECH_DOCS += technical/bitmap-format
+TECH_DOCS += technical/build-systems
TECH_DOCS += technical/bundle-uri
TECH_DOCS += technical/hash-function-transition
TECH_DOCS += technical/long-running-process-protocol
@@ -148,16 +151,12 @@ 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)' \
- -arevdate='$(GIT_DATE)'
+ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF)
ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS
TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)
@@ -182,6 +181,10 @@ endif
-include ../config.mak.autogen
-include ../config.mak
+# Set GIT_VERSION_OVERRIDE such that version_gen knows to substitute
+# GIT_VERSION in case it was set by the user.
+GIT_VERSION_OVERRIDE := $(GIT_VERSION)
+
ifndef NO_MAN_BOLD_LITERAL
XMLTO_EXTRA += -m manpage-bold-literal.xsl
endif
@@ -210,6 +213,12 @@ ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
DBLATEX_COMMON =
XMLTO_EXTRA += --skip-validation
XMLTO_EXTRA += -x manpage.xsl
+
+asciidoctor-extensions.rb: asciidoctor-extensions.rb.in FORCE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
+else
+asciidoc.conf: asciidoc.conf.in FORCE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
endif
ASCIIDOC_DEPS += docinfo.html
@@ -218,6 +227,7 @@ SHELL_PATH ?= $(SHELL)
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+ASCIIDOC_EXTRA += -abuild_dir='$(shell pwd)'
ifdef DEFAULT_PAGER
DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER))
ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)'
@@ -268,22 +278,17 @@ install-pdf: pdf
install-html: html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
-../GIT-VERSION-FILE: FORCE
- $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
-
-ifneq ($(filter-out lint-docs clean,$(MAKECMDGOALS)),)
--include ../GIT-VERSION-FILE
-endif
+mergetools_txt = mergetools-diff.txt mergetools-merge.txt
#
# Determine "include::" file references in asciidoc files.
#
docdep_prereqs = \
- mergetools-list.made $(mergetools_txt) \
+ $(mergetools_txt) \
cmd-list.made $(cmds_txt)
doc.dep : $(docdep_prereqs) $(DOC_DEP_TXT) build-docdep.perl
- $(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl >$@ $(QUIET_STDERR)
+ $(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl "$(shell pwd)" >$@ $(QUIET_STDERR)
ifneq ($(MAKECMDGOALS),clean)
-include doc.dep
@@ -305,22 +310,14 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
$(cmds_txt): cmd-list.made
cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
- $(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \
+ $(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl .. . $(cmds_txt) && \
date >$@
-mergetools_txt = mergetools-diff.txt mergetools-merge.txt
-
-$(mergetools_txt): mergetools-list.made
-
-mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
- $(QUIET_GEN) \
- $(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && TOOL_MODE=diff && \
- . ../git-mergetool--lib.sh && \
- show_tool_names can_diff' | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >mergetools-diff.txt && \
- $(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && TOOL_MODE=merge && \
- . ../git-mergetool--lib.sh && \
- show_tool_names can_merge' | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >mergetools-merge.txt && \
- date >$@
+mergetools-%.txt: generate-mergetool-list.sh ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
+mergetools-diff.txt:
+ $(QUIET_GEN)$(SHELL_PATH) ./generate-mergetool-list.sh .. diff $@
+mergetools-merge.txt:
+ $(QUIET_GEN)$(SHELL_PATH) ./generate-mergetool-list.sh .. merge $@
TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK))
@@ -341,6 +338,8 @@ clean:
$(RM) SubmittingPatches.txt
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) GIT-ASCIIDOCFLAGS
+ $(RM) asciidoc.conf asciidoctor-extensions.rb
+ $(RM) -rf tmp-meson-diff
docinfo.html: docinfo-html.in
$(QUIET_GEN)$(RM) $@ && cat $< >$@
@@ -364,16 +363,16 @@ manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
%.xml : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
-user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
+user-manual.xml: user-manual.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $<
technical/api-index.txt: technical/api-index-skel.txt \
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
- $(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
+ $(QUIET_GEN)'$(SHELL_PATH_SQ)' technical/api-index.sh ./technical ./technical/api-index.txt
technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt \
- asciidoc.conf GIT-ASCIIDOCFLAGS
+ $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
SubmittingPatches.txt: SubmittingPatches
@@ -413,16 +412,16 @@ gitman.info: gitman.texi
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
$(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@
-howto-index.txt: howto-index.sh $(HOWTO_TXT)
- $(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@
+howto-index.txt: howto/howto-index.sh $(HOWTO_TXT)
+ $(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto/howto-index.sh $(sort $(HOWTO_TXT)) >$@
-$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
+$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
WEBDOC_DEST = /pub/software/scm/git/docs
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
-$(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt GIT-ASCIIDOCFLAGS
+$(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC) \
sed -e '1,/^$$/d' $< | \
$(TXT_TO_HTML) - >$@
@@ -496,6 +495,20 @@ lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)
lint-docs-manpages:
$(QUIET_GEN)./lint-manpages.sh
+.PHONY: lint-docs-meson
+lint-docs-meson:
+ @# awk acts up when trying to match single quotes, so we use \047 instead.
+ @mkdir -p tmp-meson-diff && \
+ awk "/^manpages = {$$/ {flag=1 ; next } /^}$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047 : [157],\$$/, \"\"); print }" meson.build | \
+ grep -v -e '#' -e '^$$' | \
+ sort >tmp-meson-diff/meson.txt && \
+ ls git*.txt scalar.txt | grep -v -e git-bisect-lk2009.txt -e git-tools.txt >tmp-meson-diff/actual.txt && \
+ if ! cmp tmp-meson-diff/meson.txt tmp-meson-diff/actual.txt; then \
+ echo "Meson man pages differ from actual man pages:"; \
+ diff -u tmp-meson-diff/meson.txt tmp-meson-diff/actual.txt; \
+ exit 1; \
+ fi
+
## Lint: list of targets above
.PHONY: lint-docs
lint-docs: lint-docs-fsck-msgids
@@ -503,6 +516,7 @@ lint-docs: lint-docs-gitlink
lint-docs: lint-docs-man-end-blurb
lint-docs: lint-docs-man-section-order
lint-docs: lint-docs-manpages
+lint-docs: lint-docs-meson
ifeq ($(wildcard po/Makefile),po/Makefile)
doc-l10n install-l10n::
diff --git a/Documentation/RelNotes/2.40.4.txt b/Documentation/RelNotes/2.40.4.txt
new file mode 100644
index 0000000000..0ff29f3cfc
--- /dev/null
+++ b/Documentation/RelNotes/2.40.4.txt
@@ -0,0 +1,5 @@
+Git v2.40.4 Release Notes
+=========================
+
+This release lets Git refuse to accept URLs that contain control
+sequences. This addresses CVE-2024-50349 and CVE-2024-52006.
diff --git a/Documentation/RelNotes/2.41.3.txt b/Documentation/RelNotes/2.41.3.txt
new file mode 100644
index 0000000000..b5aba88790
--- /dev/null
+++ b/Documentation/RelNotes/2.41.3.txt
@@ -0,0 +1,6 @@
+Git v2.41.3 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4 to address
+the security issues CVE-2024-50349 and CVE-2024-52006; see the
+release notes for that version for details.
diff --git a/Documentation/RelNotes/2.42.4.txt b/Documentation/RelNotes/2.42.4.txt
new file mode 100644
index 0000000000..3129d76e75
--- /dev/null
+++ b/Documentation/RelNotes/2.42.4.txt
@@ -0,0 +1,6 @@
+Git v2.42.4 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4 and v2.41.3
+to address the security issues CVE-2024-50349 and CVE-2024-52006;
+see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.43.6.txt b/Documentation/RelNotes/2.43.6.txt
new file mode 100644
index 0000000000..2114b9f78d
--- /dev/null
+++ b/Documentation/RelNotes/2.43.6.txt
@@ -0,0 +1,7 @@
+Git v2.43.6 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4, v2.41.3
+and v2.42.4 to address the security issues CVE-2024-50349 and
+CVE-2024-52006; see the release notes for these versions for
+details.
diff --git a/Documentation/RelNotes/2.44.3.txt b/Documentation/RelNotes/2.44.3.txt
new file mode 100644
index 0000000000..5862845458
--- /dev/null
+++ b/Documentation/RelNotes/2.44.3.txt
@@ -0,0 +1,7 @@
+Git v2.44.3 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4, v2.41.3,
+v2.42.4 and v2.43.6 to address the security issues CVE-2024-50349
+and CVE-2024-52006; see the release notes for these versions
+for details.
diff --git a/Documentation/RelNotes/2.45.3.txt b/Documentation/RelNotes/2.45.3.txt
index 2a1e9aa608..ddb3cb694b 100644
--- a/Documentation/RelNotes/2.45.3.txt
+++ b/Documentation/RelNotes/2.45.3.txt
@@ -1,7 +1,12 @@
Git v2.45.3 Release Notes
=========================
-This primarily is to backport various small fixes accumulated on the
+This release merges up the fix that appears in v2.40.4, v2.41.3,
+v2.42.4, v2.43.6 and v2.44.3 to address the security issues
+CVE-2024-50349 and CVE-2024-52006; see the release notes for
+these versions for details.
+
+This version also backports various small fixes accumulated on the
'master' front during the development towards Git 2.46, the next
feature release.
diff --git a/Documentation/RelNotes/2.46.3.txt b/Documentation/RelNotes/2.46.3.txt
new file mode 100644
index 0000000000..4af032b63c
--- /dev/null
+++ b/Documentation/RelNotes/2.46.3.txt
@@ -0,0 +1,6 @@
+Git v2.46.3 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4, v2.41.3, v2.42.4,
+v2.43.6, v2.44.3 and v2.45.3 to address the security issues CVE-2024-50349 and
+CVE-2024-52006; see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.47.2.txt b/Documentation/RelNotes/2.47.2.txt
new file mode 100644
index 0000000000..7a52ad8cb4
--- /dev/null
+++ b/Documentation/RelNotes/2.47.2.txt
@@ -0,0 +1,7 @@
+Git v2.47.2 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4, v2.41.3,
+v2.42.4, v2.43.6, v2.44.3, v2.45.3 and v2.46.3 to address the
+security issues CVE-2024-50349 and CVE-2024-52006; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.48.0.txt b/Documentation/RelNotes/2.48.0.txt
index b9d1b129cd..eff93be37a 100644
--- a/Documentation/RelNotes/2.48.0.txt
+++ b/Documentation/RelNotes/2.48.0.txt
@@ -21,6 +21,24 @@ UI, Workflows & Features
* Drop support for older libcURL and Perl.
+ * End-user experience of "git mergetool" when the command errors out
+ has been improved.
+
+ * "git bundle --unbundle" and "git clone" running on a bundle file
+ both learned to trigger fsck over the new objects with configurable
+ fck check levels.
+
+ * When "git fetch $remote" notices that refs/remotes/$remote/HEAD is
+ missing and discovers what branch the other side points with its
+ HEAD, refs/remotes/$remote/HEAD is updated to point to it.
+
+ * "git fetch" honors "remote.<remote>.followRemoteHEAD" settings to
+ tweak the remote-tracking HEAD in "refs/remotes/<remote>/HEAD".
+
+ * "git range-diff" learned to optionally show and compare merge
+ commits in the ranges being compared, with the --diff-merges
+ option.
+
Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
@@ -29,15 +47,15 @@ Performance, Internal Implementation, Development Support etc.
* The way AsciiDoc is used for SYNOPSIS part of the manual pages has
been revamped. The sources, at least for the simple cases, got
- vastly pleasant to work with.
+ vastly more pleasant to work with.
* The reftable library is now prepared to expect that the memory
allocation function given to it may fail to allocate and to deal
with such an error.
* An extra worktree attached to a repository points at each other to
- allow finding the repository from the worktree and vice versa
- possible. Turn this linkage to relative paths.
+ allow finding the repository from the worktree (and vice versa)
+ possible. Use relative paths for this linkage.
* Enable Windows-based CI in GitLab.
@@ -76,7 +94,7 @@ Performance, Internal Implementation, Development Support etc.
* Update the project's CodingGuidelines to discourage naming functions
with a "_1()" suffix.
- * Updates the '.clang-format' to match project conventions.
+ * Update '.clang-format' to match project conventions.
* Centralize documentation for repository extensions into a single place.
@@ -98,7 +116,7 @@ Performance, Internal Implementation, Development Support etc.
* The migration procedure between two ref backends has been optimized.
* "git fsck" learned to issue warnings on "curiously formatted" ref
- contents that have always been taken valid but something Git
+ contents that have always been treated as valid but that Git
wouldn't have written itself (e.g., missing terminating end-of-line
after the full object name).
@@ -107,18 +125,61 @@ Performance, Internal Implementation, Development Support etc.
* Built-in Git subcommands are supplied the repository object to work
with; they learned to do the same when they invoke sub-subcommands.
+ * Drop support for ancient environments in various CI jobs.
+
+ * Isolate the reftable subsystem from the rest of Git's codebase by
+ using fewer pieces of Git's infrastructure.
+
+ * Optimize reading random references out of the reftable backend by
+ allowing reuse of iterator objects.
+
+ * Backport oss-fuzz tests to our codebase.
+
+ * Introduce a new repository extension to prevent older Git versions
+ from mis-interpreting worktrees created with relative paths.
+
+ * Yet another "pass the repository through the callchain" topic.
+
+ * "git describe" learned to stop digging the history needlessly
+ deeper.
+
+ * Build procedure update plus introduction of Meson based builds.
+
+ * Recent reftable updates mistook a NULL return from a request for
+ 0-byte allocation as OOM and died unnecessarily, which has been
+ corrected.
+
+ * Reftable backend adds check for upper limit of log's update_index.
+
+ * Start working to make the codebase buildable with -Wsign-compare.
+
+ * Regression fix for 'show-index' when run outside of a repository.
+
+ * The meson-build procedure is integrated into CI to catch and
+ prevent bitrotting.
+
+ * "git refs migrate" learned to also migrate the reflog data across
+ backends.
+
+ * The developer documentation has been updated to give the latest
+ info on gitk and git-gui maintainer.
+
+
+ * CI jobs that run threaded programs under LSan has been giving false
+ positives from time to time, which has been worked around.
+
Fixes since v2.47
-----------------
* Doc update to clarify how periodical maintenance are scheduled,
- spread across time to avoid thundering hurds.
+ spread across time to avoid thundering herds.
* Use after free and double freeing at the end in "git log -L... -p"
had been identified and fixed.
* On macOS, fsmonitor can fall into a race condition that results in
- a client waiting forever to be notified for an event that have
+ a client waiting forever to be notified about an event that has
already happened. This problem has been corrected.
* "git maintenance start" crashed due to an uninitialized variable
@@ -142,7 +203,7 @@ Fixes since v2.47
* The dumb-http code regressed when the result of re-indexing a pack
yielded an *.idx file that differs in content from the *.idx file
it downloaded from the remote. This has been corrected by no longer
- relying on: the *.idx file we got from the remote.
+ relying on the *.idx file we got from the remote.
* When called with '--left-right' and '--use-bitmap-index', 'rev-list'
will produce output without any left/right markers, which has been
@@ -166,7 +227,7 @@ Fixes since v2.47
* "git gc" discards any objects that are outside promisor packs that
are referred to by an object in a promisor pack, and we do not
refetch them from the promisor at runtime, resulting an unusable
- repository. Work it around by including these objects in the
+ repository. Work around it by including these objects in the
referring promisor pack at the receiving end of the fetch.
* Avoid build/test breakage on a system without working malloc debug
@@ -204,8 +265,66 @@ Fixes since v2.47
* The sequencer failed to honor core.commentString in some places.
+ * Describe a case where an option value needs to be spelled as a
+ separate argument, i.e. "--opt val", not "--opt=val".
+ (merge 1bc1e94091 jc/doc-opt-tilde-expand later to maint).
+
+ * Loosen overly strict ownership check introduced in the recent past,
+ to keep the promise "cloning a suspicious repository is a safe
+ first step to inspect it".
+ (merge 0ffb5a6bf1 bc/allow-upload-pack-from-other-people later to maint).
+
+ * "git fast-import" learned to reject paths with ".." and "." as
+ their components to avoid creating invalid tree objects.
+ (merge 8cb4c6e62f en/fast-import-verify-path later to maint).
+
+ * The --ancestry-path option is designed to be given a commit that is
+ on the path, which was not documented, which has been corrected.
+ (merge bc1a980759 kk/doc-ancestry-path later to maint).
+
+ * "git tag" has been taught to refuse to create refs/tags/HEAD
+ since such a tag will be confusing in the context of the UI provided by
+ the Git Porcelain commands.
+ (merge bbd445d5ef jc/forbid-head-as-tagname later to maint).
+
+ * The advice messages now tell the newer 'git config set' command to
+ set the advice.token configuration variable to squelch a message.
+ (merge 6c397d0104 bf/explicit-config-set-in-advice-messages later to maint).
+
+ * The syntax ":/<text>" to name the latest commit with the matching
+ text was broken with a recent change, which has been corrected.
+ (merge 0ff919e87a ps/commit-with-message-syntax-fix later to maint).
+
+ * Fix performance regression of a recent "fatten promisor pack with
+ local objects" protection against an unwanted gc.
+
+ * "git log -p --remerge-diff --reverse" was completely broken.
+ (merge f94bfa1516 js/log-remerge-keep-ancestry later to maint).
+
+ * "git bundle create" with an annotated tag on the positive end of
+ the revision range had a workaround code for older limitation in
+ the revision walker, which has become unnecessary.
+ (merge dd1072dfa8 tc/bundle-with-tag-remove-workaround later to maint).
+
+ * GitLab CI updates.
+ (merge c6b43f663e ps/ci-gitlab-update later to maint).
+
+ * Code to reuse objects based on bitmap contents have been tightened
+ to avoid race condition even when multiple packs are involved.
+ (merge 62b3ec8a3f tb/bitmap-fix-pack-reuse later to maint).
+
+ * An earlier "csum-file checksum does not have to be computed with
+ sha1dc" topic had a few code paths that had initialized an
+ implementation of a hash function to be used by an unmatching hash
+ by mistake, which have been corrected.
+ (merge 599a63409b ps/weak-sha1-for-tail-sum-fix later to maint).
+
* Other code cleanup, docfix, build fix, etc.
(merge 77af53f56f aa/t7300-modernize later to maint).
(merge dcd590a39d bf/t-readme-mention-reftable later to maint).
(merge 68e3c69efa kh/trailer-in-glossary later to maint).
(merge 91f88f76e6 tb/boundary-traversal-fix later to maint).
+ (merge 168ebb7159 jc/doc-error-message-guidelines later to maint).
+ (merge 18693d7d65 kh/doc-bundle-typofix later to maint).
+ (merge e2f5d3b491 kh/doc-update-ref-grammofix later to maint).
+ (merge 8525e92886 mh/doc-windows-home-env later to maint).
diff --git a/Documentation/RelNotes/2.48.1.txt b/Documentation/RelNotes/2.48.1.txt
new file mode 100644
index 0000000000..26c59b6e3b
--- /dev/null
+++ b/Documentation/RelNotes/2.48.1.txt
@@ -0,0 +1,7 @@
+Git v2.48.1 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.40.4, v2.41.3,
+v2.42.4, v2.43.6, v2.44.3, v2.45.3, v2.46.3, and v2.47.2 to address
+the security issues CVE-2024-50349 and CVE-2024-52006; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.49.0.txt b/Documentation/RelNotes/2.49.0.txt
new file mode 100644
index 0000000000..8774b4ac31
--- /dev/null
+++ b/Documentation/RelNotes/2.49.0.txt
@@ -0,0 +1,97 @@
+Git v2.49 Release Notes
+=======================
+
+UI, Workflows & Features
+------------------------
+
+ * Completion script updates for zsh
+
+
+Performance, Internal Implementation, Development Support etc.
+--------------------------------------------------------------
+
+ * More -Wsign-compare fixes.
+
+ * meson-based build now supports the unsafe-sha1 build knob.
+
+ * The code to check LSan results has been simplified and made more
+ robust.
+ (merge 164a2516eb jk/lsan-race-ignore-false-positive later to maint).
+
+ * More code paths have a repository passed through the callchain,
+ instead of assuming the primary the_repository object.
+
+ * Move a few more unit tests to the clar test framework.
+
+
+Fixes since v2.48
+-----------------
+
+ * "git submodule" learned various ways to spell the same option,
+ e.g. "--branch=B" can be spelled "--branch B" or "-bB".
+ (merge b86f0f9071 re/submodule-parse-opt later to maint).
+
+ * Tweak the help text used for the option value placeholders by
+ parse-options API so that translations can customize the "<>"
+ placeholder signal (e.g. "--option=<value>").
+ (merge 5b34dd08d0 as/long-option-help-i18n later to maint).
+
+ * CI jobs gave sporadic failures, which turns out that that the
+ object finalization code was giving an error when it did not have
+ to.
+ (merge d7fcbe2c56 ps/object-collision-check later to maint).
+
+ * The code to compute "unique" name used git_rand() which can fail or
+ get stuck; the callsite does not require cryptographic security.
+ Introduce the "insecure" mode and use it appropriately.
+ (merge 0b4f8afef6 ps/reftable-get-random-fix later to maint).
+
+ * A misconfigured "fsck.skiplist" configuration variable was not
+ diagnosed as an error, which has been corrected.
+ (merge ca7158076f jt/fsck-skiplist-parse-fix later to maint).
+
+ * Extended SHA-1 expression parser did not work well when a branch
+ with an unusual name (e.g. "foo{bar") is involved.
+ (merge 191f0c8db2 en/object-name-with-funny-refname-fix later to maint).
+
+ * The meson build procedure looked for the 'version-def.h' file in a
+ wrong directory, which has been corrected.
+ (merge 4771501c0a tc/meson-use-our-version-def-h later to maint).
+
+ * The meson build procedure for Documentation/technical/ hierarchy was
+ missing necessary dependencies, which has been corrected.
+ (merge 1dca492edd sj/meson-doc-technical-dependency-fix later to maint).
+
+ * The "instaweb" bound only to local IP address without "--local" and
+ to all addresses with "--local", which was the other way around, when
+ using Python's http.server class, which has been corrected.
+ (merge 76baf97fa1 ak/instaweb-python-port-binding-fix later to maint).
+
+ * Document that it is insecure to use Personal Access Tokens, which
+ some hosting providers take as username/password, embedded in URLs.
+ (merge a90ff409f0 mh/doc-credential-helpers-with-pat later to maint).
+
+ * The help text from "git $cmd -h" appear on the standard output for
+ some $cmd and the standard error for others. The built-in commands
+ have been fixed to show them on the standard output consistently.
+ (merge f66d1423f5 jc/show-usage-help later to maint).
+
+ * The meson-driven build is now aware of "git-subtree" housed in
+ contrib/subtree hierarchy.
+ (merge 8454b42f94 ps/build-meson-subtree later to maint).
+
+ * It was possible for "git unpack-objects" and "git index-pack" to
+ make an unaligned access, which has been corrected.
+ (merge 98046591b9 jk/pack-header-parse-alignment-fix later to maint).
+
+ * The "cache" credential back-end did not handle authtype correctly,
+ which has been corrected.
+ (merge 0b43274850 mh/credential-cache-authtype-request-fix later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+ (merge ddb5287894 jk/t7407-use-test-grep later to maint).
+ (merge 21e1b44865 aj/difftool-config-doc-fix later to maint).
+ (merge 6a63995335 mh/gitattr-doc-markup-fix later to maint).
+ (merge 43850dcf9c sk/unit-test-hash later to maint).
+ (merge 4ad47d2de3 jc/cli-doc-option-and-config later to maint).
+ (merge 2d0ff147e5 jp/t8002-printf-fix later to maint).
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index db17bc7fe2..958e3cc3d5 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -692,16 +692,17 @@ rebase when I receive your patches).
Some parts of the system have dedicated maintainers with their own
repositories.
-- `git-gui/` comes from git-gui project, maintained by Johannes Sixt:
+- `git-gui/` comes from the git-gui project, maintained by Johannes Sixt:
https://github.com/j6t/git-gui
-- `gitk-git/` comes from Paul Mackerras's gitk project:
+ Contibutions should go via the git mailing list.
- git://git.ozlabs.org/~paulus/gitk
+- `gitk-git/` comes from the gitk project, maintained by Johannes Sixt:
- Those who are interested in improving gitk can volunteer to help Paul
- maintain it, cf. <YntxL/fTplFm8lr6@cleo>.
+ https://github.com/j6t/gitk
+
+ Contibutions should go via the git mailing list.
- `po/` comes from the localization coordinator, Jiang Xin:
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf.in
index f6da6d1fbd..f2aef6cb79 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf.in
@@ -21,13 +21,26 @@ tilde=&#126;
apostrophe=&#39;
backtick=&#96;
litdd=&#45;&#45;
+manmanual=Git Manual
+mansource=Git @GIT_VERSION@
+revdate=@GIT_DATE@
+
+ifdef::doctype-book[]
+[titles]
+ underlines="__","==","--","~~","^^"
+endif::doctype-book[]
ifdef::backend-docbook[]
[linkgit-inlinemacro]
+ifndef::doctype-book[]
{0%{target}}
{0#<citerefentry>}
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
{0#</citerefentry>}
+endif::doctype-book[]
+ifdef::doctype-book[]
+<ulink url="{target}.html">{target}{0?({0})}</ulink>
+endif::doctype-book[]
[literal-inlinemacro]
{eval:re.sub(r'(&lt;[-a-zA-Z0-9.]+&gt;)', r'<emphasis>\1</emphasis>', re.sub(r'([\[\s|()>]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,\/_^\$]+\.?)+)',r'\1<literal>\2</literal>', re.sub(r'(\.\.\.?)([^\]$.])', r'<literal>\1</literal>\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))}
diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb.in
index cb24480b63..2494f17a51 100644
--- a/Documentation/asciidoctor-extensions.rb
+++ b/Documentation/asciidoctor-extensions.rb.in
@@ -29,13 +29,12 @@ module Git
class DocumentPostProcessor < Asciidoctor::Extensions::Postprocessor
def process document, output
if document.basebackend? 'docbook'
- mansource = document.attributes['mansource']
- manversion = document.attributes['manversion']
- manmanual = document.attributes['manmanual']
+ output = output.sub(/<refmiscinfo class="source">.*?<\/refmiscinfo>/, "")
+ output = output.sub(/<refmiscinfo class="manual">.*?<\/refmiscinfo>/, "")
+ output = output.sub(/<date>.*?<\/date>/, "<date>@GIT_DATE@</date>")
new_tags = "" \
- "<refmiscinfo class=\"source\">#{mansource}</refmiscinfo>\n" \
- "<refmiscinfo class=\"version\">#{manversion}</refmiscinfo>\n" \
- "<refmiscinfo class=\"manual\">#{manmanual}</refmiscinfo>\n"
+ "<refmiscinfo class=\"source\">Git @GIT_VERSION@</refmiscinfo>\n" \
+ "<refmiscinfo class=\"manual\">Git Manual</refmiscinfo>\n"
output = output.sub(/<\/refmeta>/, new_tags + "</refmeta>")
end
output
diff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl
index 1b3ac8fdd9..315efaa2fa 100755
--- a/Documentation/build-docdep.perl
+++ b/Documentation/build-docdep.perl
@@ -1,5 +1,6 @@
#!/usr/bin/perl
+my ($build_dir) = @ARGV;
my %include = ();
my %included = ();
@@ -10,6 +11,7 @@ for my $text (<*.txt>) {
chomp;
s/^include::\s*//;
s/\[\]//;
+ s/{build_dir}/${build_dir}/;
$include{$text}{$_} = 1;
$included{$_} = 1;
}
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 755a110bc4..e260a98977 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -3,12 +3,13 @@
use File::Compare qw(compare);
sub format_one {
- my ($out, $nameattr) = @_;
+ my ($source_dir, $out, $nameattr) = @_;
my ($name, $attr) = @$nameattr;
+ my ($path) = "$source_dir/Documentation/$name.txt";
my ($state, $description);
my $mansection;
$state = 0;
- open I, '<', "$name.txt" or die "No such file $name.txt";
+ open I, '<', "$path" or die "No such file $path.txt";
while (<I>) {
if (/^(?:git|scalar)[a-z0-9-]*\(([0-9])\)$/) {
$mansection = $1;
@@ -29,7 +30,7 @@ sub format_one {
}
close I;
if (!defined $description) {
- die "No description found in $name.txt";
+ die "No description found in $path.txt";
}
if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {
print $out "linkgit:$name\[$mansection\]::\n\t";
@@ -43,9 +44,9 @@ sub format_one {
}
}
-my ($input, @categories) = @ARGV;
+my ($source_dir, $build_dir, @categories) = @ARGV;
-open IN, "<$input";
+open IN, "<$source_dir/command-list.txt";
while (<IN>) {
last if /^### command list/;
}
@@ -63,17 +64,17 @@ close IN;
for my $out (@categories) {
my ($cat) = $out =~ /^cmds-(.*)\.txt$/;
- open O, '>', "$out+" or die "Cannot open output file $out+";
+ my ($path) = "$build_dir/$out";
+ open O, '>', "$path+" or die "Cannot open output file $out+";
for (@{$cmds{$cat}}) {
- format_one(\*O, $_);
+ format_one($source_dir, \*O, $_);
}
close O;
- if (-f "$out" && compare("$out", "$out+") == 0) {
- unlink "$out+";
+ if (-f "$path" && compare("$path", "$path+") == 0) {
+ unlink "$path+";
}
else {
- print STDERR "$out\n";
- rename "$out+", "$out";
+ rename "$path+", "$path";
}
}
diff --git a/Documentation/config/commit.txt b/Documentation/config/commit.txt
index 62f0d92fda..d3f4624fd2 100644
--- a/Documentation/config/commit.txt
+++ b/Documentation/config/commit.txt
@@ -1,29 +1,34 @@
-commit.cleanup::
+ifdef::git-commit[]
+:see-git-commit:
+endif::git-commit[]
+ifndef::git-commit[]
+:see-git-commit: See linkgit:git-commit[1] for details.
+endif::git-commit[]
+`commit.cleanup`::
This setting overrides the default of the `--cleanup` option in
- `git commit`. See linkgit:git-commit[1] for details. Changing the
- default can be useful when you always want to keep lines that begin
+ `git commit`. {see-git-commit} Changing the default can be useful
+ when you always want to keep lines that begin
with the comment character `#` in your log message, in which case you
would do `git config commit.cleanup whitespace` (note that you will
have to remove the help lines that begin with `#` in the commit log
template yourself, if you do this).
-commit.gpgSign::
-
+`commit.gpgSign`::
A boolean to specify whether all commits should be GPG signed.
Use of this option when doing operations such as rebase can
result in a large number of commits being signed. It may be
convenient to use an agent to avoid typing your GPG passphrase
several times.
-commit.status::
+`commit.status`::
A boolean to enable/disable inclusion of status information in the
commit message template when using an editor to prepare the commit
- message. Defaults to true.
+ message. Defaults to `true`.
-commit.template::
+`commit.template`::
Specify the pathname of a file to use as the template for
new commit messages.
-commit.verbose::
+`commit.verbose`::
A boolean or int to specify the level of verbosity with `git commit`.
- See linkgit:git-commit[1].
+ {see-git-commit}
diff --git a/Documentation/config/credential.txt b/Documentation/config/credential.txt
index 470482ff4c..80a7c77772 100644
--- a/Documentation/config/credential.txt
+++ b/Documentation/config/credential.txt
@@ -22,6 +22,17 @@ credential.useHttpPath::
or https URL to be important. Defaults to false. See
linkgit:gitcredentials[7] for more information.
+credential.sanitizePrompt::
+ By default, user names and hosts that are shown as part of the
+ password prompt are not allowed to contain control characters (they
+ will be URL-encoded by default). Configure this setting to `false` to
+ override that behavior.
+
+credential.protectProtocol::
+ By default, Carriage Return characters are not allowed in the protocol
+ that is used when Git talks to a credential helper. This setting allows
+ users to override this default.
+
credential.username::
If no username is set for a network authentication, use this username
by default. See credential.<context>.* below, and
diff --git a/Documentation/config/diff.txt b/Documentation/config/diff.txt
index 45f3fe855c..1135a62a0a 100644
--- a/Documentation/config/diff.txt
+++ b/Documentation/config/diff.txt
@@ -218,8 +218,6 @@ endif::git-diff[]
Set this option to `true` to make the diff driver cache the text
conversion outputs. See linkgit:gitattributes[5] for details.
-include::../mergetools-diff.txt[]
-
`diff.indentHeuristic`::
Set this option to `false` to disable the default heuristics
that shift diff hunk boundaries to make patches easier to read.
diff --git a/Documentation/config/difftool.txt b/Documentation/config/difftool.txt
index 447c40d85a..6cd47331a9 100644
--- a/Documentation/config/difftool.txt
+++ b/Documentation/config/difftool.txt
@@ -13,6 +13,8 @@ diff.guitool::
and requires that a corresponding difftool.<guitool>.cmd variable
is defined.
+include::{build_dir}/mergetools-diff.txt[]
+
difftool.<tool>.cmd::
Specify the command to invoke the specified diff tool.
The specified command is evaluated in shell with the following
diff --git a/Documentation/config/extensions.txt b/Documentation/config/extensions.txt
index 5dc569d1c9..5cb4721a0e 100644
--- a/Documentation/config/extensions.txt
+++ b/Documentation/config/extensions.txt
@@ -63,6 +63,12 @@ Note that this setting should only be set by linkgit:git-init[1] or
linkgit:git-clone[1]. Trying to change it after initialization will not
work and will produce hard-to-diagnose issues.
+relativeWorktrees::
+ If enabled, indicates at least one worktree has been linked with
+ relative paths. Automatically set if a worktree has been created or
+ repaired with either the `--relative-paths` option or with the
+ `worktree.useRelativePaths` config set to `true`.
+
worktreeConfig::
If enabled, then worktrees will load config settings from the
`$GIT_DIR/config.worktree` file in addition to the
diff --git a/Documentation/config/merge.txt b/Documentation/config/merge.txt
index 8851b6cede..82554d65a0 100644
--- a/Documentation/config/merge.txt
+++ b/Documentation/config/merge.txt
@@ -101,7 +101,7 @@ merge.guitool::
Any other value is treated as a custom merge tool and requires that a
corresponding mergetool.<guitool>.cmd variable is defined.
-include::../mergetools-merge.txt[]
+include::{build_dir}/mergetools-merge.txt[]
merge.verbosity::
Controls the amount of output shown by the recursive merge
diff --git a/Documentation/config/remote.txt b/Documentation/config/remote.txt
index 6d8b7d6c63..4118c219c1 100644
--- a/Documentation/config/remote.txt
+++ b/Documentation/config/remote.txt
@@ -101,6 +101,19 @@ remote.<name>.serverOption::
The default set of server options used when fetching from this remote.
These server options can be overridden by the `--server-option=` command
line arguments.
+
+remote.<name>.followRemoteHEAD::
+ How linkgit:git-fetch[1] should handle updates to `remotes/<name>/HEAD`.
+ The default value is "create", which will create `remotes/<name>/HEAD`
+ if it exists on the remote, but not locally, but will not touch an
+ already existing local reference. Setting to "warn" will print
+ a message if the remote has a different value, than the local one and
+ in case there is no local reference, it behaves like "create".
+ A variant on "warn" is "warn-if-not-$branch", which behaves like
+ "warn", but if `HEAD` on the remote is `$branch` it will be silent.
+ Setting to "always" will silently update it to the value on the remote.
+ Finally, setting it to "never" will never change or create the local
+ reference.
+
This is a multi-valued variable, and an empty value can be used in a higher
priority configuration file (e.g. `.git/config` in a repository) to clear
diff --git a/Documentation/config/worktree.txt b/Documentation/config/worktree.txt
index 048e349482..5e35c7d018 100644
--- a/Documentation/config/worktree.txt
+++ b/Documentation/config/worktree.txt
@@ -7,3 +7,13 @@ worktree.guessRemote::
such a branch exists, it is checked out and set as "upstream"
for the new branch. If no such match can be found, it falls
back to creating a new branch from the current HEAD.
+
+worktree.useRelativePaths::
+ Link worktrees using relative paths (when "true") or absolute
+ paths (when "false"). This is particularly useful for setups
+ where the repository and worktrees may be moved between
+ different locations or environments. Defaults to "false".
++
+Note that setting `worktree.useRelativePaths` to "true" implies enabling the
+`extension.relativeWorktrees` config (see linkgit:git-config[1]),
+thus making it incompatible with older versions of Git.
diff --git a/Documentation/generate-mergetool-list.sh b/Documentation/generate-mergetool-list.sh
new file mode 100755
index 0000000000..6700498b93
--- /dev/null
+++ b/Documentation/generate-mergetool-list.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if test "$#" -ne 3
+then
+ echo >&2 "USAGE: $0 <SOURCE_DIR> <MODE> <OUTPUT>"
+ exit 1
+fi
+
+SOURCE_DIR="$1"
+TOOL_MODE="$2"
+OUTPUT="$3"
+MERGE_TOOLS_DIR="$SOURCE_DIR/mergetools"
+
+(
+ . "$SOURCE_DIR"/git-mergetool--lib.sh &&
+ show_tool_names can_$TOOL_MODE
+) | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >"$OUTPUT"
diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 504b8a8143..03cd36fe8d 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -32,7 +32,7 @@ Git commands that fetch or otherwise "read" via protocols such as
possible linkgit:git-clone[1] a new repository from a bundle, to use
linkgit:git-fetch[1] to fetch from one, and to list the references
contained within it with linkgit:git-ls-remote[1]. There's no
-corresponding "write" support, i.e.a 'git push' into a bundle is not
+corresponding "write" support, i.e. a 'git push' into a bundle is not
supported.
BUNDLE FORMAT
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 7acb4cb176..de8d8f5893 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -63,6 +63,9 @@ symbolic link, the clone will fail. This is a security measure to
prevent the unintentional copying of files by dereferencing the symbolic
links.
+
+This option does not work with repositories owned by other users for security
+reasons, and `--no-local` must be specified for the clone to succeed.
++
*NOTE*: this operation can race with concurrent modification to the
source repository, similar to running `cp -r <src> <dst>` while modifying
_<src>_.
@@ -384,6 +387,12 @@ $ cd my-linux
$ git clone --bare -l /home/proj/.git /pub/scm/proj.git
------------
+* Clone a local repository from a different user:
++
+------------
+$ git clone --no-local /home/otheruser/proj.git /pub/scm/proj.git
+------------
+
CONFIGURATION
-------------
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index c822113c11..602e2f1200 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -7,8 +7,8 @@ git-commit - Record changes to the repository
SYNOPSIS
--------
-[verse]
-'git commit' [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
+[synopsis]
+git commit [-a | --interactive | --patch] [-s] [-v] [-u[<mode>]] [--amend]
[--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>]
[-F <file> | -m <msg>] [--reset-author] [--allow-empty]
[--allow-empty-message] [--no-verify] [-e] [--author=<author>]
@@ -23,31 +23,31 @@ Create a new commit containing the current contents of the index and
the given log message describing the changes. The new commit is a
direct child of HEAD, usually the tip of the current branch, and the
branch is updated to point to it (unless no branch is associated with
-the working tree, in which case HEAD is "detached" as described in
+the working tree, in which case `HEAD` is "detached" as described in
linkgit:git-checkout[1]).
The content to be committed can be specified in several ways:
1. by using linkgit:git-add[1] to incrementally "add" changes to the
- index before using the 'commit' command (Note: even modified files
+ index before using the `commit` command (Note: even modified files
must be "added");
2. by using linkgit:git-rm[1] to remove files from the working tree
- and the index, again before using the 'commit' command;
+ and the index, again before using the `commit` command;
-3. by listing files as arguments to the 'commit' command
- (without --interactive or --patch switch), in which
+3. by listing files as arguments to the `commit` command
+ (without `--interactive` or `--patch` switch), in which
case the commit will ignore changes staged in the index, and instead
record the current content of the listed files (which must already
be known to Git);
-4. by using the -a switch with the 'commit' command to automatically
+4. by using the `-a` switch with the `commit` command to automatically
"add" changes from all known files (i.e. all files that are already
listed in the index) and to automatically "rm" files in the index
that have been removed from the working tree, and then perform the
actual commit;
-5. by using the --interactive or --patch switches with the 'commit' command
+5. by using the `--interactive` or `--patch` switches with the `commit` command
to decide one by one which files or hunks should be part of the commit
in addition to contents in the index,
before finalizing the operation. See the ``Interactive Mode'' section of
@@ -58,139 +58,139 @@ summary of what is included by any of the above for the next
commit by giving the same set of parameters (options and paths).
If you make a commit and then find a mistake immediately after
-that, you can recover from it with 'git reset'.
+that, you can recover from it with `git reset`.
:git-commit: 1
OPTIONS
-------
--a::
---all::
- Tell the command to automatically stage files that have
+`-a`::
+`--all`::
+ Automatically stage files that have
been modified and deleted, but new files you have not
told Git about are not affected.
--p::
---patch::
+`-p`::
+`--patch`::
Use the interactive patch selection interface to choose
which changes to commit. See linkgit:git-add[1] for
details.
--C <commit>::
---reuse-message=<commit>::
- Take an existing commit object, and reuse the log message
+`-C <commit>`::
+`--reuse-message=<commit>`::
+ Take an existing _<commit>_ object, and reuse the log message
and the authorship information (including the timestamp)
when creating the commit.
--c <commit>::
---reedit-message=<commit>::
- Like '-C', but with `-c` the editor is invoked, so that
+`-c <commit>`::
+`--reedit-message=<commit>`::
+ Like `-C`, but with `-c` the editor is invoked, so that
the user can further edit the commit message.
---fixup=[(amend|reword):]<commit>::
- Create a new commit which "fixes up" `<commit>` when applied with
+`--fixup=[(amend|reword):]<commit>`::
+ Create a new commit which "fixes up" _<commit>_ when applied with
`git rebase --autosquash`. Plain `--fixup=<commit>` creates a
- "fixup!" commit which changes the content of `<commit>` but leaves
+ "fixup!" commit which changes the content of _<commit>_ but leaves
its log message untouched. `--fixup=amend:<commit>` is similar but
creates an "amend!" commit which also replaces the log message of
- `<commit>` with the log message of the "amend!" commit.
+ _<commit>_ with the log message of the "amend!" commit.
`--fixup=reword:<commit>` creates an "amend!" commit which
- replaces the log message of `<commit>` with its own log message
- but makes no changes to the content of `<commit>`.
+ replaces the log message of _<commit>_ with its own log message
+ but makes no changes to the content of _<commit>_.
+
The commit created by plain `--fixup=<commit>` has a subject
-composed of "fixup!" followed by the subject line from <commit>,
+composed of "fixup!" followed by the subject line from _<commit>_,
and is recognized specially by `git rebase --autosquash`. The `-m`
option may be used to supplement the log message of the created
commit, but the additional commentary will be thrown away once the
-"fixup!" commit is squashed into `<commit>` by
+"fixup!" commit is squashed into _<commit>_ by
`git rebase --autosquash`.
+
The commit created by `--fixup=amend:<commit>` is similar but its
subject is instead prefixed with "amend!". The log message of
-<commit> is copied into the log message of the "amend!" commit and
+_<commit>_ is copied into the log message of the "amend!" commit and
opened in an editor so it can be refined. When `git rebase
---autosquash` squashes the "amend!" commit into `<commit>`, the
-log message of `<commit>` is replaced by the refined log message
+--autosquash` squashes the "amend!" commit into _<commit>_, the
+log message of _<commit>_ is replaced by the refined log message
from the "amend!" commit. It is an error for the "amend!" commit's
log message to be empty unless `--allow-empty-message` is
specified.
+
`--fixup=reword:<commit>` is shorthand for `--fixup=amend:<commit>
---only`. It creates an "amend!" commit with only a log message
+ --only`. It creates an "amend!" commit with only a log message
(ignoring any changes staged in the index). When squashed by `git
-rebase --autosquash`, it replaces the log message of `<commit>`
+rebase --autosquash`, it replaces the log message of _<commit>_
without making any other changes.
+
Neither "fixup!" nor "amend!" commits change authorship of
-`<commit>` when applied by `git rebase --autosquash`.
+_<commit>_ when applied by `git rebase --autosquash`.
See linkgit:git-rebase[1] for details.
---squash=<commit>::
- Construct a commit message for use with `rebase --autosquash`.
+`--squash=<commit>`::
+ Construct a commit message for use with `git rebase --autosquash`.
The commit message subject line is taken from the specified
commit with a prefix of "squash! ". Can be used with additional
commit message options (`-m`/`-c`/`-C`/`-F`). See
linkgit:git-rebase[1] for details.
---reset-author::
- When used with -C/-c/--amend options, or when committing after a
+`--reset-author`::
+ When used with `-C`/`-c`/`--amend` options, or when committing after a
conflicting cherry-pick, declare that the authorship of the
resulting commit now belongs to the committer. This also renews
the author timestamp.
---short::
+`--short`::
When doing a dry-run, give the output in the short-format. See
linkgit:git-status[1] for details. Implies `--dry-run`.
---branch::
+`--branch`::
Show the branch and tracking info even in short-format.
---porcelain::
+`--porcelain`::
When doing a dry-run, give the output in a porcelain-ready
format. See linkgit:git-status[1] for details. Implies
`--dry-run`.
---long::
+`--long`::
When doing a dry-run, give the output in the long-format.
Implies `--dry-run`.
--z::
---null::
+`-z`::
+`--null`::
When showing `short` or `porcelain` status output, print the
- filename verbatim and terminate the entries with NUL, instead of LF.
+ filename verbatim and terminate the entries with _NUL_, instead of _LF_.
If no format is given, implies the `--porcelain` output format.
Without the `-z` option, filenames with "unusual" characters are
quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]).
--F <file>::
---file=<file>::
- Take the commit message from the given file. Use '-' to
+`-F <file>`::
+`--file=<file>`::
+ Take the commit message from _<file>_. Use '-' to
read the message from the standard input.
---author=<author>::
+`--author=<author>`::
Override the commit author. Specify an explicit author using the
- standard `A U Thor <author@example.com>` format. Otherwise <author>
+ standard `A U Thor <author@example.com>` format. Otherwise _<author>_
is assumed to be a pattern and is used to search for an existing
- commit by that author (i.e. rev-list --all -i --author=<author>);
+ commit by that author (i.e. `git rev-list --all -i --author=<author>`);
the commit author is then copied from the first such commit found.
---date=<date>::
+`--date=<date>`::
Override the author date used in the commit.
--m <msg>::
---message=<msg>::
- Use the given <msg> as the commit message.
+`-m <msg>`::
+`--message=<msg>`::
+ Use _<msg>_ as the commit message.
If multiple `-m` options are given, their values are
concatenated as separate paragraphs.
+
The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.
--t <file>::
---template=<file>::
+`-t <file>`::
+`--template=<file>`::
When editing the commit message, start the editor with the
- contents in the given file. The `commit.template` configuration
+ contents in _<file>_. The `commit.template` configuration
variable is often used to give this option implicitly to the
command. This mechanism can be used by projects that want to
guide participants with some hints on what to write in the message
@@ -200,56 +200,54 @@ The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.
include::signoff-option.txt[]
---trailer <token>[(=|:)<value>]::
- Specify a (<token>, <value>) pair that should be applied as a
+`--trailer <token>[(=|:)<value>]`::
+ Specify a (_<token>_, _<value>_) pair that should be applied as a
trailer. (e.g. `git commit --trailer "Signed-off-by:C O Mitter \
<committer@example.com>" --trailer "Helped-by:C O Mitter \
- <committer@example.com>"` will add the "Signed-off-by" trailer
- and the "Helped-by" trailer to the commit message.)
+ <committer@example.com>"` will add the `Signed-off-by` trailer
+ and the `Helped-by` trailer to the commit message.)
The `trailer.*` configuration variables
(linkgit:git-interpret-trailers[1]) can be used to define if
a duplicated trailer is omitted, where in the run of trailers
each trailer would appear, and other details.
--n::
---[no-]verify::
- By default, the pre-commit and commit-msg hooks are run.
- When any of `--no-verify` or `-n` is given, these are bypassed.
+`-n`::
+`--[no-]verify`::
+ Bypass the `pre-commit` and `commit-msg` hooks.
See also linkgit:githooks[5].
---allow-empty::
+`--allow-empty`::
Usually recording a commit that has the exact same tree as its
sole parent commit is a mistake, and the command prevents you
from making such a commit. This option bypasses the safety, and
is primarily for use by foreign SCM interface scripts.
---allow-empty-message::
- Like --allow-empty this command is primarily for use by foreign
- SCM interface scripts. It allows you to create a commit with an
- empty commit message without using plumbing commands like
- linkgit:git-commit-tree[1].
+`--allow-empty-message`::
+ Create a commit with an empty commit message without using plumbing
+ commands like linkgit:git-commit-tree[1]. Like `--allow-empty`, this
+ command is primarily for use by foreign SCM interface scripts.
---cleanup=<mode>::
- This option determines how the supplied commit message should be
+`--cleanup=<mode>`::
+ Determine how the supplied commit message should be
cleaned up before committing. The '<mode>' can be `strip`,
`whitespace`, `verbatim`, `scissors` or `default`.
+
--
-strip::
+`strip`::
Strip leading and trailing empty lines, trailing whitespace,
commentary and collapse consecutive empty lines.
-whitespace::
+`whitespace`::
Same as `strip` except #commentary is not removed.
-verbatim::
+`verbatim`::
Do not change the message at all.
-scissors::
+`scissors`::
Same as `whitespace` except that everything from (and including)
the line found below is truncated, if the message is to be edited.
- "`#`" can be customized with core.commentChar.
+ "`#`" can be customized with `core.commentChar`.
# ------------------------ >8 ------------------------
-default::
+`default`::
Same as `strip` if the message is to be edited.
Otherwise `whitespace`.
--
@@ -257,19 +255,18 @@ default::
The default can be changed by the `commit.cleanup` configuration
variable (see linkgit:git-config[1]).
--e::
---edit::
- The message taken from file with `-F`, command line with
- `-m`, and from commit object with `-C` are usually used as
- the commit log message unmodified. This option lets you
- further edit the message taken from these sources.
+`-e`::
+`--edit`::
+ Let the user further edit the message taken from _<file>_
+ with `-F <file>`, command line with `-m <message>`, and
+ from _<commit>_ with `-C <commit>`.
---no-edit::
+`--no-edit`::
Use the selected commit message without launching an editor.
For example, `git commit --amend --no-edit` amends a commit
without changing its commit message.
---amend::
+`--amend`::
Replace the tip of the current branch by creating a new
commit. The recorded tree is prepared as usual (including
the effect of the `-i` and `-o` options and explicit
@@ -295,23 +292,23 @@ You should understand the implications of rewriting history if you
amend a commit that has already been published. (See the "RECOVERING
FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
---no-post-rewrite::
- Bypass the post-rewrite hook.
+`--no-post-rewrite`::
+ Bypass the `post-rewrite` hook.
--i::
---include::
+`-i`::
+`--include`::
Before making a commit out of staged contents so far,
stage the contents of paths given on the command line
as well. This is usually not what you want unless you
are concluding a conflicted merge.
--o::
---only::
+`-o`::
+`--only`::
Make a commit by taking the updated working tree contents
of the paths specified on the
command line, disregarding any contents that have been
staged for other paths. This is the default mode of operation of
- 'git commit' if any paths are given on the command line,
+ `git commit` if any paths are given on the command line,
in which case this option can be omitted.
If this option is specified together with `--amend`, then
no paths need to be specified, which can be used to amend
@@ -319,48 +316,48 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
already been staged. If used together with `--allow-empty`
paths are also not required, and an empty commit will be created.
---pathspec-from-file=<file>::
- Pathspec is passed in `<file>` instead of commandline args. If
- `<file>` is exactly `-` then standard input is used. Pathspec
- elements are separated by LF or CR/LF. Pathspec elements can be
+`--pathspec-from-file=<file>`::
+ Pass pathspec in _<file>_ instead of commandline args. If
+ _<file>_ is exactly `-` then standard input is used. Pathspec
+ elements are separated by _LF_ or _CR_/_LF_. Pathspec elements can be
quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
global `--literal-pathspecs`.
---pathspec-file-nul::
+`--pathspec-file-nul`::
Only meaningful with `--pathspec-from-file`. Pathspec elements are
- separated with NUL character and all other characters are taken
+ separated with _NUL_ character and all other characters are taken
literally (including newlines and quotes).
--u[<mode>]::
---untracked-files[=<mode>]::
+`-u[<mode>]`::
+`--untracked-files[=<mode>]`::
Show untracked files.
+
--
-The mode parameter is optional (defaults to 'all'), and is used to
-specify the handling of untracked files; when -u is not used, the
-default is 'normal', i.e. show untracked files and directories.
+The _<mode>_ parameter is optional (defaults to `all`), and is used to
+specify the handling of untracked files; when `-u` is not used, the
+default is `normal`, i.e. show untracked files and directories.
The possible options are:
- - 'no' - Show no untracked files
- - 'normal' - Shows untracked files and directories
- - 'all' - Also shows individual files in untracked directories.
+`no`:: Show no untracked files
+`normal`:: Shows untracked files and directories
+`all`:: Also shows individual files in untracked directories.
All usual spellings for Boolean value `true` are taken as `normal`
and `false` as `no`.
-The default can be changed using the status.showUntrackedFiles
+The default can be changed using the `status.showUntrackedFiles`
configuration variable documented in linkgit:git-config[1].
--
--v::
---verbose::
- Show unified diff between the HEAD commit and what
+`-v`::
+`--verbose`::
+ Show unified diff between the `HEAD` commit and what
would be committed at the bottom of the commit message
template to help the user describe the commit by reminding
what changes the commit has.
Note that this diff output doesn't have its
- lines prefixed with '#'. This diff will not be a part
+ lines prefixed with `#`. This diff will not be a part
of the commit message. See the `commit.verbose` configuration
variable in linkgit:git-config[1].
+
@@ -368,40 +365,40 @@ If specified twice, show in addition the unified diff between
what would be committed and the worktree files, i.e. the unstaged
changes to tracked files.
--q::
---quiet::
+`-q`::
+`--quiet`::
Suppress commit summary message.
---dry-run::
+`--dry-run`::
Do not create a commit, but show a list of paths that are
to be committed, paths with local changes that will be left
uncommitted and paths that are untracked.
---status::
+`--status`::
Include the output of linkgit:git-status[1] in the commit
message template when using an editor to prepare the commit
message. Defaults to on, but can be used to override
- configuration variable commit.status.
+ configuration variable `commit.status`.
---no-status::
+`--no-status`::
Do not include the output of linkgit:git-status[1] in the
commit message template when using an editor to prepare the
default commit message.
--S[<keyid>]::
---gpg-sign[=<keyid>]::
---no-gpg-sign::
- GPG-sign commits. The `keyid` argument is optional and
+`-S[<key-id>]`::
+`--gpg-sign[=<key-id>]`::
+`--no-gpg-sign`::
+ GPG-sign commits. The _<key-id>_ is optional and
defaults to the committer identity; if specified, it must be
stuck to the option without a space. `--no-gpg-sign` is useful to
countermand both `commit.gpgSign` configuration variable, and
earlier `--gpg-sign`.
-\--::
+`--`::
Do not interpret any more arguments as options.
-<pathspec>...::
- When pathspec is given on the command line, commit the contents of
+`<pathspec>...`::
+ When _<pathspec>_ is given on the command line, commit the contents of
the files that match the pathspec without recording the changes
already added to the index. The contents of these files are also
staged for the next commit on top of what have been staged before.
@@ -412,10 +409,10 @@ EXAMPLES
--------
When recording your own work, the contents of modified files in
your working tree are temporarily stored to a staging area
-called the "index" with 'git add'. A file can be
+called the "index" with `git add`. A file can be
reverted back, only in the index but not in the working tree,
to that of the last commit with `git restore --staged <file>`,
-which effectively reverts 'git add' and prevents the changes to
+which effectively reverts `git add` and prevents the changes to
this file from participating in the next commit. After building
the state to be committed incrementally with these commands,
`git commit` (without any pathname parameter) is used to record what
@@ -443,7 +440,7 @@ $ git commit -a
------------
The command `git commit -a` first looks at your working tree,
-notices that you have modified hello.c and removed goodbye.c,
+notices that you have modified `hello.c` and removed `goodbye.c`,
and performs necessary `git add` and `git rm` for you.
After staging changes to many files, you can alter the order the
@@ -471,13 +468,13 @@ $ git commit
this second commit would record the changes to `hello.c` and
`hello.h` as expected.
-After a merge (initiated by 'git merge' or 'git pull') stops
+After a merge (initiated by `git merge` or `git pull`) stops
because of conflicts, cleanly merged
paths are already staged to be committed for you, and paths that
conflicted are left in unmerged state. You would have to first
-check which paths are conflicting with 'git status'
+check which paths are conflicting with `git status`
and after fixing them manually in your working tree, you would
-stage the result as usual with 'git add':
+stage the result as usual with `git add`:
------------
$ git status | grep unmerged
@@ -507,12 +504,12 @@ COMMIT INFORMATION
Author and committer information is taken from the following environment
variables, if set:
- GIT_AUTHOR_NAME
- GIT_AUTHOR_EMAIL
- GIT_AUTHOR_DATE
- GIT_COMMITTER_NAME
- GIT_COMMITTER_EMAIL
- GIT_COMMITTER_DATE
+ * `GIT_AUTHOR_NAME`
+ * `GIT_AUTHOR_EMAIL`
+ * `GIT_AUTHOR_DATE`
+ * `GIT_COMMITTER_NAME`
+ * `GIT_COMMITTER_EMAIL`
+ * `GIT_COMMITTER_DATE`
(nb "<", ">" and "\n"s are stripped)
@@ -524,7 +521,7 @@ that, see the `credential.username` variable in linkgit:git-config[1].
In case (some of) these environment variables are not set, the information
is taken from the configuration items `user.name` and `user.email`, or, if not
-present, the environment variable EMAIL, or, if that is not set,
+present, the environment variable `EMAIL`, or, if that is not set,
system user name and the hostname used for outgoing mail (taken
from `/etc/mailname` and falling back to the fully qualified hostname when
that file does not exist).
@@ -555,7 +552,7 @@ include::i18n.txt[]
ENVIRONMENT AND CONFIGURATION VARIABLES
---------------------------------------
The editor used to edit the commit log message will be chosen from the
-`GIT_EDITOR` environment variable, the core.editor configuration variable, the
+`GIT_EDITOR` environment variable, the `core.editor` configuration variable, the
`VISUAL` environment variable, or the `EDITOR` environment variable (in that
order). See linkgit:git-var[1] for details.
diff --git a/Documentation/git-credential-cache.txt b/Documentation/git-credential-cache.txt
index 487cc557a8..54fa7a27e1 100644
--- a/Documentation/git-credential-cache.txt
+++ b/Documentation/git-credential-cache.txt
@@ -78,6 +78,23 @@ variable (this example increases the cache time to 1 hour):
$ git config credential.helper 'cache --timeout=3600'
-------------------------------------------------------
+PERSONAL ACCESS TOKENS
+----------------------
+
+Some remotes accept personal access tokens, which are randomly
+generated and hard to memorise. They typically have a lifetime of weeks
+or months.
+
+git-credential-cache is inherently unsuitable for persistent storage of
+personal access tokens. The credential will be forgotten after the cache
+timeout. Even if you configure a long timeout, credentials will be
+forgotten if the daemon dies.
+
+To avoid frequently regenerating personal access tokens, configure a
+credential helper with persistent storage. Alternatively, configure an
+OAuth credential helper to generate credentials automatically. See
+linkgit:gitcredentials[7], sections "Available helpers" and "OAuth".
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt
index fbdbe0befe..db0e4279b5 100644
--- a/Documentation/git-range-diff.txt
+++ b/Documentation/git-range-diff.txt
@@ -10,7 +10,8 @@ SYNOPSIS
[verse]
'git range-diff' [--color=[<when>]] [--no-color] [<diff-options>]
[--no-dual-color] [--creation-factor=<factor>]
- [--left-only | --right-only]
+ [--left-only | --right-only] [--diff-merges=<format>]
+ [--remerge-diff]
( <range1> <range2> | <rev1>...<rev2> | <base> <rev1> <rev2> )
[[--] <path>...]
@@ -81,6 +82,20 @@ to revert to color all lines according to the outer diff markers
Suppress commits that are missing from the second specified range
(or the "right range" when using the `<rev1>...<rev2>` format).
+--diff-merges=<format>::
+ Instead of ignoring merge commits, generate diffs for them using the
+ corresponding `--diff-merges=<format>` option of linkgit:git-log[1],
+ and include them in the comparison.
++
+Note: In the common case, the `remerge` mode will be the most natural one
+to use, as it shows only the diff on top of what Git's merge machinery would
+have produced. In other words, if a merge commit is the result of a
+non-conflicting `git merge`, the `remerge` mode will represent it with an empty
+diff.
+
+--remerge-diff::
+ Convenience option, equivalent to `--diff-merges=remerge`.
+
--[no-]notes[=<ref>]::
This flag is passed to the `git log` program
(see linkgit:git-log[1]) that generates the patches.
diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt
index 8a4281cde9..9e6935d38d 100644
--- a/Documentation/git-update-ref.txt
+++ b/Documentation/git-update-ref.txt
@@ -93,11 +93,11 @@ update::
ref does not exist before the update.
create::
- Create <ref> with <new-oid> after verifying it does not
+ Create <ref> with <new-oid> after verifying that it does not
exist. The given <new-oid> may not be zero.
delete::
- Delete <ref> after verifying it exists with <old-oid>, if
+ Delete <ref> after verifying that it exists with <old-oid>, if
given. If given, <old-oid> may not be zero.
symref-update::
@@ -110,11 +110,11 @@ verify::
<old-oid> is zero or missing, the ref must not exist.
symref-create:
- Create symbolic ref <ref> with <new-target> after verifying
+ Create symbolic ref <ref> with <new-target> after verifying that
it does not exist.
symref-delete::
- Delete <ref> after verifying it exists with <old-target>, if given.
+ Delete <ref> after verifying that it exists with <old-target>, if given.
symref-verify::
Verify symbolic <ref> against <old-target> but do not change it.
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index 70437c815f..8340b7f028 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -216,6 +216,14 @@ To remove a locked worktree, specify `--force` twice.
This can also be set up as the default behaviour by using the
`worktree.guessRemote` config option.
+--[no-]relative-paths::
+ Link worktrees using relative paths or absolute paths (default).
+ Overrides the `worktree.useRelativePaths` config option, see
+ linkgit:git-config[1].
++
+With `repair`, the linking files will be updated if there's an absolute/relative
+mismatch, even if the links are correct.
+
--[no-]track::
When creating a new branch, if `<commit-ish>` is a branch,
mark it as "upstream" from the new branch. This is the
diff --git a/Documentation/git.txt b/Documentation/git.txt
index d15a869762..e89a91dd0d 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -245,17 +245,17 @@ ancillary user utilities.
Main porcelain commands
~~~~~~~~~~~~~~~~~~~~~~~
-include::cmds-mainporcelain.txt[]
+include::{build_dir}/cmds-mainporcelain.txt[]
Ancillary Commands
~~~~~~~~~~~~~~~~~~
Manipulators:
-include::cmds-ancillarymanipulators.txt[]
+include::{build_dir}/cmds-ancillarymanipulators.txt[]
Interrogators:
-include::cmds-ancillaryinterrogators.txt[]
+include::{build_dir}/cmds-ancillaryinterrogators.txt[]
Interacting with Others
@@ -264,7 +264,7 @@ Interacting with Others
These commands are to interact with foreign SCM and with other
people via patch over e-mail.
-include::cmds-foreignscminterface.txt[]
+include::{build_dir}/cmds-foreignscminterface.txt[]
Reset, restore and revert
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -313,13 +313,13 @@ repositories.
Manipulation commands
~~~~~~~~~~~~~~~~~~~~~
-include::cmds-plumbingmanipulators.txt[]
+include::{build_dir}/cmds-plumbingmanipulators.txt[]
Interrogation commands
~~~~~~~~~~~~~~~~~~~~~~
-include::cmds-plumbinginterrogators.txt[]
+include::{build_dir}/cmds-plumbinginterrogators.txt[]
In general, the interrogate commands do not touch the files in
the working tree.
@@ -328,12 +328,12 @@ the working tree.
Syncing repositories
~~~~~~~~~~~~~~~~~~~~
-include::cmds-synchingrepositories.txt[]
+include::{build_dir}/cmds-synchingrepositories.txt[]
The following are helper commands used by the above; end users
typically do not use them directly.
-include::cmds-synchelpers.txt[]
+include::{build_dir}/cmds-synchelpers.txt[]
Internal helper commands
@@ -342,14 +342,14 @@ Internal helper commands
These are internal helper commands used by other commands; end
users typically do not use them directly.
-include::cmds-purehelpers.txt[]
+include::{build_dir}/cmds-purehelpers.txt[]
Guides
------
The following documentation pages are guides about Git concepts.
-include::cmds-guide.txt[]
+include::{build_dir}/cmds-guide.txt[]
Repository, command and file interfaces
---------------------------------------
@@ -358,7 +358,7 @@ This documentation discusses repository and command interfaces which
users are expected to interact with directly. See `--user-formats` in
linkgit:git-help[1] for more details on the criteria.
-include::cmds-userinterfaces.txt[]
+include::{build_dir}/cmds-userinterfaces.txt[]
File formats, protocols and other developer interfaces
------------------------------------------------------
@@ -367,7 +367,7 @@ This documentation discusses file formats, over-the-wire protocols and
other git developer interfaces. See `--developer-interfaces` in
linkgit:git-help[1].
-include::cmds-developerinterfaces.txt[]
+include::{build_dir}/cmds-developerinterfaces.txt[]
Configuration Mechanism
-----------------------
@@ -477,6 +477,14 @@ their values the same way as Boolean valued configuration variables, e.g.
Here are the variables:
+System
+~~~~~~
+`HOME`::
+ Specifies the path to the user's home directory. On Windows, if
+ unset, Git will set a process environment variable equal to:
+ `$HOMEDRIVE$HOMEPATH` if both `$HOMEDRIVE` and `$HOMEPATH` exist;
+ otherwise `$USERPROFILE` if `$USERPROFILE` exists.
+
The Git Repository
~~~~~~~~~~~~~~~~~~
These environment variables apply to 'all' core Git commands. Nb: it
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index e6150595af..5d12b78549 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -1166,7 +1166,7 @@ internal merge and the final merge.
The merge driver can learn the pathname in which the merged result
will be stored via placeholder `%P`. The conflict labels to be used
for the common ancestor, local head and other head can be passed by
-using '%S', '%X' and '%Y` respectively.
+using `%S`, `%X` and `%Y` respectively.
`conflict-marker-size`
^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
index 7c709324ba..04193ec907 100644
--- a/Documentation/gitcli.txt
+++ b/Documentation/gitcli.txt
@@ -90,6 +90,15 @@ scripting Git:
for long options. An option that takes optional option-argument must be
written in the 'stuck' form.
+ * Despite the above suggestion, when Arg is a path relative to the
+ home directory of a user, e.g. `~/directory/file` or `~u/d/f`, you
+ may want to use the separate form, e.g. `git foo --file ~/mine`,
+ not `git foo --file=~/mine`. The shell will expand `~/` in the
+ former to your home directory, but most shells keep the tilde in
+ the latter. Some of our commands know how to tilde-expand the
+ option value even when given in the stuck form, but not all of
+ them do.
+
* When you give a revision parameter to a command, make sure the parameter is
not ambiguous with a name of a file in the work tree. E.g. do not write
`git log -1 HEAD` but write `git log -1 HEAD --`; the former will not work
@@ -152,6 +161,23 @@ can use `--no-track` to override that behaviour. The same goes for `--color`
and `--no-color`.
+Options trump configuration and environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When there is a configuration variable or an environment variable
+that tweak the behaviour of an aspect of a Git command, and also a
+command line option that tweaks the same, the command line option
+overrides what the configuration and/or environment variable say.
+
+For example, the `user.name` configuration variable is used to
+specify the human-readable name used by the `git commit` command to
+record the author and the committer name in a newly created commit.
+The `GIT_AUTHOR_NAME` environment variable, if set, takes precedence
+when deciding what author name to record. The `--author=<author>`
+command line option of the `git commit` command, when given, takes
+precedence over these two sources of information.
+
+
Aggregating short options
~~~~~~~~~~~~~~~~~~~~~~~~~
Commands that support the enhanced option parser allow you to aggregate short
diff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt
index 71dd19731a..3337bb475d 100644
--- a/Documentation/gitcredentials.txt
+++ b/Documentation/gitcredentials.txt
@@ -66,18 +66,7 @@ storage provided by the OS or other programs. Alternatively, a
credential-generating helper might generate credentials for certain servers via
some API.
-To use a helper, you must first select one to use. Git currently
-includes the following helpers:
-
-cache::
-
- Cache credentials in memory for a short period of time. See
- linkgit:git-credential-cache[1] for details.
-
-store::
-
- Store credentials indefinitely on disk. See
- linkgit:git-credential-store[1] for details.
+To use a helper, you must first select one to use (see below for a list).
You may also have third-party helpers installed; search for
`credential-*` in the output of `git help -a`, and consult the
@@ -106,6 +95,28 @@ $ git config --global credential.helper foo
=== Available helpers
+Git currently includes the following helpers:
+
+cache::
+
+ Cache credentials in memory for a short period of time. See
+ linkgit:git-credential-cache[1] for details.
+
+store::
+
+ Store credentials indefinitely on disk. See
+ linkgit:git-credential-store[1] for details.
+
+Popular helpers with secure persistent storage include:
+
+ - git-credential-libsecret (Linux)
+
+ - git-credential-osxkeychain (macOS)
+
+ - git-credential-wincred (Windows)
+
+ - https://github.com/git-ecosystem/git-credential-manager[Git Credential Manager] (cross platform, included in Git for Windows)
+
The community maintains a comprehensive list of Git credential helpers at
https://git-scm.com/doc/credential-helpers.
@@ -116,6 +127,12 @@ OAuth credential helper. Initial authentication opens a browser window to the
host. Subsequent authentication happens in the background. Many popular Git
hosts support OAuth.
+Popular helpers with OAuth support include:
+
+ - https://github.com/git-ecosystem/git-credential-manager[Git Credential Manager] (cross platform, included in Git for Windows)
+
+ - https://github.com/hickford/git-credential-oauth[git-credential-oauth] (cross platform, included in many Linux distributions)
+
CREDENTIAL CONTEXTS
-------------------
@@ -242,6 +259,12 @@ Here are some example specifications:
[credential]
helper = "foo --bar='whitespace arg'"
+# store helper (discouraged) with custom location for the db file;
+# use `--file ~/.git-secret.txt`, rather than `--file=~/.git-secret.txt`,
+# to allow the shell to expand tilde to the home directory.
+[credential]
+ helper = "store --file ~/.git-secret.txt"
+
# you can also use an absolute path, which will not use the git wrapper
[credential]
helper = "/path/to/my/helper --with-arguments"
diff --git a/Documentation/howto-index.sh b/Documentation/howto/howto-index.sh
index 167b363668..eecd123a93 100755
--- a/Documentation/howto-index.sh
+++ b/Documentation/howto/howto-index.sh
@@ -48,7 +48,7 @@ do
file="$txt"
fi
- echo "* link:$file[$title] $from
+ echo "* link:howto/$(basename "$file")[$title] $from
$abstract
"
diff --git a/Documentation/howto/meson.build b/Documentation/howto/meson.build
new file mode 100644
index 0000000000..c023c10416
--- /dev/null
+++ b/Documentation/howto/meson.build
@@ -0,0 +1,62 @@
+howto_sources = [
+ 'coordinate-embargoed-releases.txt',
+ 'keep-canonical-history-correct.txt',
+ 'maintain-git.txt',
+ 'new-command.txt',
+ 'rebase-from-internal-branch.txt',
+ 'rebuild-from-update-hook.txt',
+ 'recover-corrupted-blob-object.txt',
+ 'recover-corrupted-object-harder.txt',
+ 'revert-a-faulty-merge.txt',
+ 'revert-branch-rebase.txt',
+ 'separating-topic-branches.txt',
+ 'setup-git-server-over-http.txt',
+ 'update-hook-example.txt',
+ 'use-git-daemon.txt',
+ 'using-merge-subtree.txt',
+ 'using-signed-tag-in-pull-request.txt',
+]
+
+howto_index = custom_target(
+ command: [
+ shell,
+ meson.current_source_dir() / 'howto-index.sh',
+ '@INPUT@',
+ ],
+ env: script_environment,
+ capture: true,
+ input: howto_sources,
+ output: 'howto-index.txt',
+)
+
+custom_target(
+ command: asciidoc_html_options,
+ input: howto_index,
+ output: 'howto-index.html',
+ depends: documentation_deps,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+)
+
+foreach howto : howto_sources
+ howto_stripped = custom_target(
+ command: [
+ find_program('sed'),
+ '-e',
+ '1,/^$/d',
+ '@INPUT@',
+ ],
+ input: howto,
+ output: fs.stem(howto) + '.stripped',
+ capture: true,
+ )
+
+ custom_target(
+ command: asciidoc_html_options,
+ input: howto_stripped,
+ output: fs.stem(howto_stripped.full_path()) + '.html',
+ depends: documentation_deps,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc/howto',
+ )
+endforeach
diff --git a/Documentation/i18n.txt b/Documentation/i18n.txt
index 3a866af4a4..baff780a7e 100644
--- a/Documentation/i18n.txt
+++ b/Documentation/i18n.txt
@@ -34,7 +34,7 @@ project find it more convenient to use legacy encodings, Git
does not forbid it. However, there are a few things to keep in
mind.
-. 'git commit' and 'git commit-tree' issue
+. `git commit` and `git commit-tree` issue
a warning if the commit log message given to it does not look
like a valid UTF-8 string, unless you explicitly say your
project uses a legacy encoding. The way to say this is to
@@ -50,7 +50,7 @@ of `i18n.commitEncoding` in their `encoding` header. This is to
help other people who look at them later. Lack of this header
implies that the commit log message is encoded in UTF-8.
-. 'git log', 'git show', 'git blame' and friends look at the
+. `git log`, `git show`, `git blame` and friends look at the
`encoding` header of a commit object, and try to re-code the
log message into UTF-8 unless otherwise specified. You can
specify the desired output encoding with
diff --git a/Documentation/meson.build b/Documentation/meson.build
new file mode 100644
index 0000000000..2a26fa8a5f
--- /dev/null
+++ b/Documentation/meson.build
@@ -0,0 +1,504 @@
+manpages = {
+ # Category 1.
+ 'git-add.txt' : 1,
+ 'git-am.txt' : 1,
+ 'git-annotate.txt' : 1,
+ 'git-apply.txt' : 1,
+ 'git-archimport.txt' : 1,
+ 'git-archive.txt' : 1,
+ 'git-bisect.txt' : 1,
+ 'git-blame.txt' : 1,
+ 'git-branch.txt' : 1,
+ 'git-bugreport.txt' : 1,
+ 'git-bundle.txt' : 1,
+ 'git-cat-file.txt' : 1,
+ 'git-check-attr.txt' : 1,
+ 'git-check-ignore.txt' : 1,
+ 'git-check-mailmap.txt' : 1,
+ 'git-checkout-index.txt' : 1,
+ 'git-checkout.txt' : 1,
+ 'git-check-ref-format.txt' : 1,
+ 'git-cherry-pick.txt' : 1,
+ 'git-cherry.txt' : 1,
+ 'git-citool.txt' : 1,
+ 'git-clean.txt' : 1,
+ 'git-clone.txt' : 1,
+ 'git-column.txt' : 1,
+ 'git-commit-graph.txt' : 1,
+ 'git-commit-tree.txt' : 1,
+ 'git-commit.txt' : 1,
+ 'git-config.txt' : 1,
+ 'git-count-objects.txt' : 1,
+ 'git-credential-cache--daemon.txt' : 1,
+ 'git-credential-cache.txt' : 1,
+ 'git-credential-store.txt' : 1,
+ 'git-credential.txt' : 1,
+ 'git-cvsexportcommit.txt' : 1,
+ 'git-cvsimport.txt' : 1,
+ 'git-cvsserver.txt' : 1,
+ 'git-daemon.txt' : 1,
+ 'git-describe.txt' : 1,
+ 'git-diagnose.txt' : 1,
+ 'git-diff-files.txt' : 1,
+ 'git-diff-index.txt' : 1,
+ 'git-difftool.txt' : 1,
+ 'git-diff-tree.txt' : 1,
+ 'git-diff.txt' : 1,
+ 'git-fast-export.txt' : 1,
+ 'git-fast-import.txt' : 1,
+ 'git-fetch-pack.txt' : 1,
+ 'git-fetch.txt' : 1,
+ 'git-filter-branch.txt' : 1,
+ 'git-fmt-merge-msg.txt' : 1,
+ 'git-for-each-ref.txt' : 1,
+ 'git-for-each-repo.txt' : 1,
+ 'git-format-patch.txt' : 1,
+ 'git-fsck-objects.txt' : 1,
+ 'git-fsck.txt' : 1,
+ 'git-fsmonitor--daemon.txt' : 1,
+ 'git-gc.txt' : 1,
+ 'git-get-tar-commit-id.txt' : 1,
+ 'git-grep.txt' : 1,
+ 'git-gui.txt' : 1,
+ 'git-hash-object.txt' : 1,
+ 'git-help.txt' : 1,
+ 'git-hook.txt' : 1,
+ 'git-http-backend.txt' : 1,
+ 'git-http-fetch.txt' : 1,
+ 'git-http-push.txt' : 1,
+ 'git-imap-send.txt' : 1,
+ 'git-index-pack.txt' : 1,
+ 'git-init-db.txt' : 1,
+ 'git-init.txt' : 1,
+ 'git-instaweb.txt' : 1,
+ 'git-interpret-trailers.txt' : 1,
+ 'git-log.txt' : 1,
+ 'git-ls-files.txt' : 1,
+ 'git-ls-remote.txt' : 1,
+ 'git-ls-tree.txt' : 1,
+ 'git-mailinfo.txt' : 1,
+ 'git-mailsplit.txt' : 1,
+ 'git-maintenance.txt' : 1,
+ 'git-merge-base.txt' : 1,
+ 'git-merge-file.txt' : 1,
+ 'git-merge-index.txt' : 1,
+ 'git-merge-one-file.txt' : 1,
+ 'git-mergetool--lib.txt' : 1,
+ 'git-mergetool.txt' : 1,
+ 'git-merge-tree.txt' : 1,
+ 'git-merge.txt' : 1,
+ 'git-mktag.txt' : 1,
+ 'git-mktree.txt' : 1,
+ 'git-multi-pack-index.txt' : 1,
+ 'git-mv.txt' : 1,
+ 'git-name-rev.txt' : 1,
+ 'git-notes.txt' : 1,
+ 'git-p4.txt' : 1,
+ 'git-pack-objects.txt' : 1,
+ 'git-pack-redundant.txt' : 1,
+ 'git-pack-refs.txt' : 1,
+ 'git-patch-id.txt' : 1,
+ 'git-prune-packed.txt' : 1,
+ 'git-prune.txt' : 1,
+ 'git-pull.txt' : 1,
+ 'git-push.txt' : 1,
+ 'git-quiltimport.txt' : 1,
+ 'git-range-diff.txt' : 1,
+ 'git-read-tree.txt' : 1,
+ 'git-rebase.txt' : 1,
+ 'git-receive-pack.txt' : 1,
+ 'git-reflog.txt' : 1,
+ 'git-refs.txt' : 1,
+ 'git-remote-ext.txt' : 1,
+ 'git-remote-fd.txt' : 1,
+ 'git-remote.txt' : 1,
+ 'git-repack.txt' : 1,
+ 'git-replace.txt' : 1,
+ 'git-replay.txt' : 1,
+ 'git-request-pull.txt' : 1,
+ 'git-rerere.txt' : 1,
+ 'git-reset.txt' : 1,
+ 'git-restore.txt' : 1,
+ 'git-revert.txt' : 1,
+ 'git-rev-list.txt' : 1,
+ 'git-rev-parse.txt' : 1,
+ 'git-rm.txt' : 1,
+ 'git-send-email.txt' : 1,
+ 'git-send-pack.txt' : 1,
+ 'git-shell.txt' : 1,
+ 'git-sh-i18n--envsubst.txt' : 1,
+ 'git-sh-i18n.txt' : 1,
+ 'git-shortlog.txt' : 1,
+ 'git-show-branch.txt' : 1,
+ 'git-show-index.txt' : 1,
+ 'git-show-ref.txt' : 1,
+ 'git-show.txt' : 1,
+ 'git-sh-setup.txt' : 1,
+ 'git-sparse-checkout.txt' : 1,
+ 'git-stage.txt' : 1,
+ 'git-stash.txt' : 1,
+ 'git-status.txt' : 1,
+ 'git-stripspace.txt' : 1,
+ 'git-submodule.txt' : 1,
+ 'git-svn.txt' : 1,
+ 'git-switch.txt' : 1,
+ 'git-symbolic-ref.txt' : 1,
+ 'git-tag.txt' : 1,
+ 'git-unpack-file.txt' : 1,
+ 'git-unpack-objects.txt' : 1,
+ 'git-update-index.txt' : 1,
+ 'git-update-ref.txt' : 1,
+ 'git-update-server-info.txt' : 1,
+ 'git-upload-archive.txt' : 1,
+ 'git-upload-pack.txt' : 1,
+ 'git-var.txt' : 1,
+ 'git-verify-commit.txt' : 1,
+ 'git-verify-pack.txt' : 1,
+ 'git-verify-tag.txt' : 1,
+ 'git-version.txt' : 1,
+ 'git-web--browse.txt' : 1,
+ 'git-whatchanged.txt' : 1,
+ 'git-worktree.txt' : 1,
+ 'git-write-tree.txt' : 1,
+ 'git.txt' : 1,
+ 'gitk.txt' : 1,
+ 'gitweb.txt' : 1,
+ 'scalar.txt' : 1,
+
+ # Category 5.
+ 'gitattributes.txt' : 5,
+ 'gitformat-bundle.txt' : 5,
+ 'gitformat-chunk.txt' : 5,
+ 'gitformat-commit-graph.txt' : 5,
+ 'gitformat-index.txt' : 5,
+ 'gitformat-pack.txt' : 5,
+ 'gitformat-signature.txt' : 5,
+ 'githooks.txt' : 5,
+ 'gitignore.txt' : 5,
+ 'gitmailmap.txt' : 5,
+ 'gitmodules.txt' : 5,
+ 'gitprotocol-capabilities.txt' : 5,
+ 'gitprotocol-common.txt' : 5,
+ 'gitprotocol-http.txt' : 5,
+ 'gitprotocol-pack.txt' : 5,
+ 'gitprotocol-v2.txt' : 5,
+ 'gitrepository-layout.txt' : 5,
+ 'gitweb.conf.txt' : 5,
+
+ # Category 7.
+ 'gitcli.txt' : 7,
+ 'gitcore-tutorial.txt' : 7,
+ 'gitcredentials.txt' : 7,
+ 'gitcvs-migration.txt' : 7,
+ 'gitdiffcore.txt' : 7,
+ 'giteveryday.txt' : 7,
+ 'gitfaq.txt' : 7,
+ 'gitglossary.txt' : 7,
+ 'gitpacking.txt' : 7,
+ 'gitnamespaces.txt' : 7,
+ 'gitremote-helpers.txt' : 7,
+ 'gitrevisions.txt' : 7,
+ 'gitsubmodules.txt' : 7,
+ 'gittutorial-2.txt' : 7,
+ 'gittutorial.txt' : 7,
+ 'gitworkflows.txt' : 7,
+}
+
+docs_backend = get_option('docs_backend')
+if docs_backend == 'auto'
+ if find_program('asciidoc', required: false).found()
+ docs_backend = 'asciidoc'
+ elif find_program('asciidoctor', required: false).found()
+ docs_backend = 'asciidoctor'
+ else
+ error('Neither asciidoc nor asciidoctor were found.')
+ endif
+endif
+
+if docs_backend == 'asciidoc'
+ asciidoc = find_program('asciidoc', required: true)
+ asciidoc_html = 'xhtml11'
+ asciidoc_docbook = 'docbook'
+ xmlto_extra = [ ]
+
+ asciidoc_conf = custom_target(
+ command: [
+ shell,
+ meson.project_source_root() / 'GIT-VERSION-GEN',
+ meson.project_source_root(),
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ input: 'asciidoc.conf.in',
+ output: 'asciidoc.conf',
+ depends: [git_version_file],
+ env: version_gen_environment,
+ )
+
+ asciidoc_common_options = [
+ asciidoc,
+ '--conf-file=' + asciidoc_conf.full_path(),
+ '--attribute=build_dir=' + meson.current_build_dir(),
+ ]
+
+ documentation_deps = [
+ asciidoc_conf,
+ ]
+elif docs_backend == 'asciidoctor'
+ asciidoctor = find_program('asciidoctor', required: true)
+ asciidoc_html = 'xhtml5'
+ asciidoc_docbook = 'docbook5'
+ xmlto_extra = [
+ '--skip-validation',
+ '-x', meson.current_source_dir() / 'manpage.xsl',
+ ]
+
+ asciidoctor_extensions = custom_target(
+ command: [
+ shell,
+ meson.project_source_root() / 'GIT-VERSION-GEN',
+ meson.project_source_root(),
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ input: 'asciidoctor-extensions.rb.in',
+ output: 'asciidoctor-extensions.rb',
+ depends: [git_version_file],
+ env: version_gen_environment,
+ )
+
+ asciidoc_common_options = [
+ asciidoctor,
+ '--attribute', 'compat-mode',
+ '--attribute', 'tabsize=8',
+ '--attribute', 'litdd=&#x2d;&#x2d;',
+ '--attribute', 'docinfo=shared',
+ '--attribute', 'build_dir=' + meson.current_build_dir(),
+ '--load-path', meson.current_build_dir(),
+ '--require', 'asciidoctor-extensions',
+ ]
+
+ documentation_deps = [
+ asciidoctor_extensions,
+ ]
+endif
+
+git = find_program('git', required: false)
+xmlto = find_program('xmlto')
+
+cmd_lists = [
+ 'cmds-ancillaryinterrogators.txt',
+ 'cmds-ancillarymanipulators.txt',
+ 'cmds-mainporcelain.txt',
+ 'cmds-plumbinginterrogators.txt',
+ 'cmds-plumbingmanipulators.txt',
+ 'cmds-synchingrepositories.txt',
+ 'cmds-synchelpers.txt',
+ 'cmds-guide.txt',
+ 'cmds-developerinterfaces.txt',
+ 'cmds-userinterfaces.txt',
+ 'cmds-purehelpers.txt',
+ 'cmds-foreignscminterface.txt',
+]
+
+documentation_deps += custom_target(
+ command: [
+ perl,
+ '@INPUT@',
+ meson.project_source_root(),
+ meson.current_build_dir(),
+ ] + cmd_lists,
+ input: 'cmd-list.perl',
+ output: cmd_lists
+)
+
+foreach mode : [ 'diff', 'merge' ]
+ documentation_deps += custom_target(
+ command: [
+ shell,
+ '@INPUT@',
+ '..',
+ mode,
+ '@OUTPUT@'
+ ],
+ env: [
+ 'MERGE_TOOLS_DIR=' + meson.project_source_root() / 'mergetools',
+ ],
+ input: 'generate-mergetool-list.sh',
+ output: 'mergetools-' + mode + '.txt',
+ )
+endforeach
+
+foreach manpage, category : manpages
+ if get_option('docs').contains('man')
+ manpage_xml_target = custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_docbook,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: manpage,
+ output: fs.stem(manpage) + '.xml',
+ )
+
+ manpage_path = fs.stem(manpage) + '.' + category.to_string()
+ manpage_target = custom_target(
+ command: [
+ xmlto,
+ '-m', '@INPUT0@',
+ '-m', '@INPUT1@',
+ '--stringparam',
+ 'man.base.url.for.relative.links=' + get_option('prefix') / get_option('mandir'),
+ 'man',
+ manpage_xml_target,
+ '-o',
+ meson.current_build_dir(),
+ ] + xmlto_extra,
+ input: [
+ 'manpage-normal.xsl',
+ 'manpage-bold-literal.xsl',
+ ],
+ output: manpage_path,
+ install: true,
+ install_dir: get_option('mandir') / 'man' + category.to_string(),
+ )
+ endif
+
+ if get_option('docs').contains('html')
+ custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_html,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: manpage,
+ output: fs.stem(manpage) + '.html',
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+ endif
+endforeach
+
+if get_option('docs').contains('html')
+ configure_file(
+ input: 'docinfo-html.in',
+ output: 'docinfo.html',
+ copy: true,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+
+ configure_file(
+ input: 'docbook-xsl.css',
+ output: 'docbook-xsl.css',
+ copy: true,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+
+ install_symlink('index.html',
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ pointing_to: 'git.html',
+ )
+
+ xsltproc = find_program('xsltproc')
+
+ user_manual_xml = custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_docbook,
+ '--doctype=book',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ input: 'user-manual.txt',
+ output: 'user-manual.xml',
+ depends: documentation_deps,
+ )
+
+ custom_target(
+ command: [
+ xsltproc,
+ '--xinclude',
+ '--stringparam', 'html.stylesheet', 'docbook-xsl.css',
+ '--param', 'generate.consistent.ids', '1',
+ '--output', '@OUTPUT@',
+ '@INPUT@',
+ user_manual_xml,
+ ],
+ input: 'docbook.xsl',
+ output: 'user-manual.html',
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+
+ articles = [
+ 'DecisionMaking.txt',
+ 'MyFirstContribution.txt',
+ 'MyFirstObjectWalk.txt',
+ 'ReviewingGuidelines.txt',
+ 'SubmittingPatches',
+ 'ToolsForGit.txt',
+ 'git-bisect-lk2009.txt',
+ 'git-tools.txt',
+ ]
+
+ foreach article : articles
+ custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_html,
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ input: article,
+ output: fs.stem(article) + '.html',
+ depends: documentation_deps,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+ endforeach
+
+ asciidoc_html_options = asciidoc_common_options + [
+ '--backend=' + asciidoc_html,
+ '--out-file=@OUTPUT@',
+ '--attribute', 'git-relative-html-prefix=../',
+ '@INPUT@',
+ ]
+
+ subdir('howto')
+ subdir('technical')
+endif
+
+# Sanity check that we are not missing any tests present in 't/'. This check
+# only runs once at configure time and is thus best-effort, only. Furthermore,
+# it only verifies man pages for the sake of simplicity.
+configured_manpages = manpages.keys() + [ 'git-bisect-lk2009.txt', 'git-tools.txt' ]
+actual_manpages = run_command(shell, '-c', 'ls git*.txt scalar.txt',
+ check: true,
+ env: script_environment,
+).stdout().strip().split('\n')
+
+if configured_manpages != actual_manpages
+ missing_manpage = [ ]
+ foreach actual_manpage : actual_manpages
+ if actual_manpage not in configured_manpages
+ missing_manpage += actual_manpage
+ endif
+ endforeach
+ if missing_manpage.length() > 0
+ error('Man page found, but not configured:\n\n - ' + '\n - '.join(missing_manpage))
+ endif
+
+ superfluous_manpage = [ ]
+ foreach configured_manpage : configured_manpages
+ if configured_manpage not in actual_manpages
+ superfluous_manpage += configured_manpage
+ endif
+ endforeach
+ if superfluous_manpage.length() > 0
+ error('Man page configured, but not found:\n\n - ' + '\n - '.join(superfluous_manpage))
+ endif
+endif
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 00ccf68744..459e5a02f5 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -412,7 +412,8 @@ Default mode::
--ancestry-path[=<commit>]::
When given a range of commits to display (e.g. 'commit1..commit2'
- or 'commit2 {caret}commit1'), only display commits in that range
+ or 'commit2 {caret}commit1'), and a commit <commit> in that range,
+ only display commits in that range
that are ancestors of <commit>, descendants of <commit>, or
<commit> itself. If no commit is specified, use 'commit1' (the
excluded part of the range) as <commit>. Can be passed multiple
diff --git a/Documentation/signoff-option.txt b/Documentation/signoff-option.txt
index d98758f3cb..cddfb225d1 100644
--- a/Documentation/signoff-option.txt
+++ b/Documentation/signoff-option.txt
@@ -1,8 +1,8 @@
ifdef::git-commit[]
--s::
+`-s`::
endif::git-commit[]
---signoff::
---no-signoff::
+`--signoff`::
+`--no-signoff`::
Add a `Signed-off-by` trailer by the committer at the end of the commit
log message. The meaning of a signoff depends on the project
to which you're committing. For example, it may certify that
@@ -14,5 +14,5 @@ endif::git-commit[]
leadership of the project to which you're contributing to
understand how the signoffs are used in that project.
+
-The --no-signoff option can be used to countermand an earlier --signoff
+The `--no-signoff` option can be used to countermand an earlier `--signoff`
option on the command line.
diff --git a/Documentation/technical/api-index.sh b/Documentation/technical/api-index.sh
index 9c3f4131b8..2964885574 100755
--- a/Documentation/technical/api-index.sh
+++ b/Documentation/technical/api-index.sh
@@ -1,6 +1,17 @@
#!/bin/sh
+if test $# -ne 2
+then
+ echo >&2 "USAGE: $0 <SOURCE_DIR> <OUTPUT>"
+ exit 1
+fi
+
+SOURCE_DIR="$1"
+OUTPUT="$2"
+
(
+ cd "$SOURCE_DIR"
+
c=////////////////////////////////////////////////////////////////
skel=api-index-skel.txt
sed -e '/^\/\/ table of contents begin/q' "$skel"
@@ -18,11 +29,11 @@
done
echo "$c"
sed -n -e '/^\/\/ table of contents end/,$p' "$skel"
-) >api-index.txt+
+) >"$OUTPUT"+
-if test -f api-index.txt && cmp api-index.txt api-index.txt+ >/dev/null
+if test -f "$OUTPUT" && cmp "$OUTPUT" "$OUTPUT"+ >/dev/null
then
- rm -f api-index.txt+
+ rm -f "$OUTPUT"+
else
- mv api-index.txt+ api-index.txt
+ mv "$OUTPUT"+ "$OUTPUT"
fi
diff --git a/Documentation/technical/api-path-walk.txt b/Documentation/technical/api-path-walk.txt
new file mode 100644
index 0000000000..7075d0d5ab
--- /dev/null
+++ b/Documentation/technical/api-path-walk.txt
@@ -0,0 +1,63 @@
+Path-Walk API
+=============
+
+The path-walk API is used to walk reachable objects, but to visit objects
+in batches based on a common path they appear in, or by type.
+
+For example, all reachable commits are visited in a group. All tags are
+visited in a group. Then, all root trees are visited. At some point, all
+blobs reachable via a path `my/dir/to/A` are visited. When there are
+multiple paths possible to reach the same object, then only one of those
+paths is used to visit the object.
+
+Basics
+------
+
+To use the path-walk API, include `path-walk.h` and call
+`walk_objects_by_path()` with a customized `path_walk_info` struct. The
+struct is used to set all of the options for how the walk should proceed.
+Let's dig into the different options and their use.
+
+`path_fn` and `path_fn_data`::
+ The most important option is the `path_fn` option, which is a
+ function pointer to the callback that can execute logic on the
+ object IDs for objects grouped by type and path. This function
+ also receives a `data` value that corresponds to the
+ `path_fn_data` member, for providing custom data structures to
+ this callback function.
+
+`revs`::
+ To configure the exact details of the reachable set of objects,
+ use the `revs` member and initialize it using the revision
+ machinery in `revision.h`. Initialize `revs` using calls such as
+ `setup_revisions()` or `parse_revision_opt()`. Do not call
+ `prepare_revision_walk()`, as that will be called within
+ `walk_objects_by_path()`.
++
+It is also important that you do not specify the `--objects` flag for the
+`revs` struct. The revision walk should only be used to walk commits, and
+the objects will be walked in a separate way based on those starting
+commits.
+
+`commits`, `blobs`, `trees`, `tags`::
+ By default, these members are enabled and signal that the path-walk
+ API should call the `path_fn` on objects of these types. Specialized
+ applications could disable some options to make it simpler to walk
+ the objects or to have fewer calls to `path_fn`.
++
+While it is possible to walk only commits in this way, consumers would be
+better off using the revision walk API instead.
+
+`prune_all_uninteresting`::
+ By default, all reachable paths are emitted by the path-walk API.
+ This option allows consumers to declare that they are not
+ interested in paths where all included objects are marked with the
+ `UNINTERESTING` flag. This requires using the `boundary` option in
+ the revision walk so that the walk emits commits marked with the
+ `UNINTERESTING` flag.
+
+Examples
+--------
+
+See example usages in:
+ `t/helper/test-path-walk.c`
diff --git a/Documentation/technical/build-systems.txt b/Documentation/technical/build-systems.txt
new file mode 100644
index 0000000000..d9dafb407c
--- /dev/null
+++ b/Documentation/technical/build-systems.txt
@@ -0,0 +1,224 @@
+= Build Systems
+
+The build system is the primary way for both developers and system integrators
+to interact with the Git project. As such, being easy to use and extend for
+those who are not directly developing Git itself is just as important as other
+requirements we have on any potential build system.
+
+This document outlines the different requirements that we have for the build
+system and then compares available build systems using these criteria.
+
+== Requirements
+
+The following subsections present a list of requirements that we have for any
+potential build system. Sections are sorted by decreasing priority.
+
+=== Platform support
+
+The build system must have support for all of our platforms that we continually
+test against as outlined by our platform support policy. These platforms are:
+
+ - Linux
+ - Windows
+ - macOS
+
+Furthermore, the build system should have support for the following platforms
+that generally have somebody running test pipelines against regularly:
+
+ - AIX
+ - FreeBSD
+ - NetBSD
+ - NonStop
+ - OpenBSD
+
+The platforms which must be supported by the tool should be aligned with our
+[platform support policy](platform-support.txt).
+
+=== Auto-detection of supported features
+
+The build system must support auto-detection of features which are or aren't
+available on the current platform. Platform maintainers should not be required
+to manually configure the complete build.
+
+Auto-detection of the following items is considered to be important:
+
+ - Check for the existence of headers.
+ - Check for the existence of libraries.
+ - Check for the existence of exectuables.
+ - Check for the runtime behavior of specific functions.
+ - Check for specific link order requirements when multiple libraries are
+ involved.
+
+=== Ease of use
+
+The build system should be both easy to use and easy to extend. While this is
+naturally a subjective metric it is likely not controversial to say that some
+build systems are considerably harder to use than others.
+
+=== IDE support
+
+The build system should integrate with well-known IDEs. Well-known IDEs include:
+
+ - Microsoft Visual Studio
+ - Visual Studio Code
+ - Xcode
+
+There are four levels of support:
+
+ - Native integration into the IDE.
+ - Integration into the IDE via a plugin.
+ - Integration into the IDE via generating a project description with the build
+ system.
+ - No integration.
+
+Native integration is preferable, but integration via either a plugin or by
+generating a project description via the build system are considered feasible
+alternatives.
+
+Another important distinction is the level of integration. There are two
+features that one generally wants to have:
+
+ - Integration of build targets.
+ - Automatic setup of features like code completion with detected build
+ dependencies.
+
+The first bullet point is the bare minimum, but is not sufficient to be
+considered proper integration.
+
+=== Out-of-tree builds
+
+The build system should support out-of-tree builds. Out-of-tree builds allow a
+developer to configure multiple different build directories with different
+configuration, e.g. one "debug" build and one "release" build.
+
+=== Cross-platform builds
+
+The build system should support cross-platform builds, e.g. building for arm on
+an x86-64 host.
+
+=== Language support
+
+The following languages and toolchains are of relevance and should be supported
+by the build system:
+
+ - C: the primary compiled language used by Git, must be supported. Relevant
+ toolchains are GCC, Clang and MSVC.
+ - Rust: candidate as a second compiled lanugage, should be supported. Relevant
+ toolchains is the LLVM-based rustc.
+
+Built-in support for the respective languages is preferred over support that
+needs to be wired up manually to avoid unnecessary complexity. Native support
+includes the following features:
+
+ - Compiling objects.
+ - Dependency tracking.
+ - Detection of available features.
+ - Discovery of relevant toolchains.
+ - Linking libraries and executables.
+ - Templating placeholders in scripts.
+
+=== Test integration
+
+It should be possible to integrate tests into the build system such that it is
+possible to build and test Git within the build system. Features which are nice
+to have:
+
+ - Track build-time dependencies for respective tests. Unit tests have
+ different requirements than integration tests.
+ - Allow filtering of which tests to run.
+ - Allow running tests such that utilities like `test_pause` or `debug` work.
+
+== Comparison
+
+The following list of build systems are considered:
+
+- GNU Make
+- autoconf
+- CMake
+- Meson
+
+=== GNU Make
+
+- Platform support: ubitquitous on all platforms, but not well-integrated into Windows.
+- Auto-detection: no built-in support for auto-detection of features.
+- Ease of use: easy to use, but discovering available options is hard. Makefile
+ rules can quickly get out of hand once reaching a certain scope.
+- IDE support: execution of Makefile targets is supported by many IDEs
+- Out-of-tree builds: supported in theory, not wired up in practice.
+- Cross-platform builds: supported in theory, not wired up in practice.
+- Language support:
+ - C: Limited built-in support, many parts need to be wired up manually.
+ - Rust: No built-in support, needs to be wired up manually.
+- Test integration: partially supported, many parts need to be wired up
+ manually.
+
+=== autoconf
+
+- Platform support: ubiquitous on all platforms, but not well-integrated into Windows.
+- Auto-detection: supported.
+- Ease of use: easy to use, discovering available options is comparatively
+ easy. The autoconf syntax is prohibitively hard to extend though due to its
+ complex set of interacting files and the hard-to-understand M4 language.
+- IDE support: no integration into IDEs at generation time. The generated
+ Makefiles have the same level of support as GNU Make.
+- Out-of-tree builds: supported in theory, not wired up in practice.
+- Cross-platform builds: supported.
+- Language support:
+ - C: Limited built-in support, many parts need to be wired up manually.
+ - Rust: No built-in support, needs to be wired up manually.
+- Test integration: partially supported, many parts need to be wired up
+ manually.
+
+=== CMake
+
+- Platform support: not as extensive as GNU Make or autoconf, but all major
+ platforms are supported.
+ - AIX
+ - Cygwin
+ - FreeBSD
+ - Linux
+ - OpenBSD
+ - Solaris
+ - Windows
+ - macOS
+- Ease of use: easy to use, discovering available options is not always
+ trivial. The scripting language used by CMake is somewhat cumbersome to use,
+ but extending CMake build instructions is doable.
+- IDE support: natively integrated into Microsoft Visual Studio. Can generate
+ project descriptions for Xcode. An extension is available for Visual Studio
+ Code. Many other IDEs have plugins for CMake.
+- Out-of-tree builds: supported.
+- Cross-platform builds: supported.
+- Language support:
+ - C: Supported for GCC, Clang, MSVC and other toolchains.
+ - Rust: No built-in support, needs to be wired up manually.
+- Test integration: supported, even though test dependencies are a bit
+ cumbersome to use via "test fixtures". Interactive test runs are not
+ supported.
+
+=== Meson
+
+- Platform: not as extensive as GNU Make or autoconf, but all major platforms
+ and some smaller ones are supported.
+ - AIX
+ - Cygwin
+ - DragonflyBSD
+ - FreeBSD
+ - Haiku
+ - Linux
+ - NetBSD
+ - OpenBSD
+ - Solaris
+ - Windows
+ - macOS
+- Ease of use: easy to use, discovering available options is easy. The
+ scripting language is straight-forward to use.
+- IDE support: Supports generating build instructions for Xcode and Microsoft
+ Visual Studio, a plugin exists for Visual Studio Code.
+- Out-of-tree builds: supported.
+- Cross-platform builds: supported.
+- Language support:
+ - C: Supported for GCC, Clang, MSVC and other toolchains.
+ - Rust: Supported for rustc.
+- Test integration: supported. Interactive tests are supported starting with
+ Meson 1.5.0 via the `--interactive` flag.
diff --git a/Documentation/technical/meson.build b/Documentation/technical/meson.build
new file mode 100644
index 0000000000..3a65ee59b3
--- /dev/null
+++ b/Documentation/technical/meson.build
@@ -0,0 +1,67 @@
+api_docs = [
+ 'api-error-handling.txt',
+ 'api-merge.txt',
+ 'api-parse-options.txt',
+ 'api-simple-ipc.txt',
+ 'api-trace2.txt',
+]
+
+articles = [
+ 'bitmap-format.txt',
+ 'build-systems.txt',
+ 'bundle-uri.txt',
+ 'commit-graph.txt',
+ 'directory-rename-detection.txt',
+ 'hash-function-transition.txt',
+ 'long-running-process-protocol.txt',
+ 'multi-pack-index.txt',
+ 'packfile-uri.txt',
+ 'pack-heuristics.txt',
+ 'parallel-checkout.txt',
+ 'partial-clone.txt',
+ 'platform-support.txt',
+ 'racy-git.txt',
+ 'reftable.txt',
+ 'remembering-renames.txt',
+ 'repository-version.txt',
+ 'rerere.txt',
+ 'scalar.txt',
+ 'send-pack-pipeline.txt',
+ 'shallow.txt',
+ 'sparse-checkout.txt',
+ 'sparse-index.txt',
+ 'trivial-merge.txt',
+ 'unit-tests.txt',
+]
+
+api_index = custom_target(
+ command: [
+ shell,
+ meson.current_source_dir() / 'api-index.sh',
+ meson.current_source_dir(),
+ '@OUTPUT@',
+ ],
+ env: script_environment,
+ input: api_docs,
+ output: 'api-index.txt',
+)
+
+custom_target(
+ command: asciidoc_html_options,
+ input: api_index,
+ output: 'api-index.html',
+ depends: documentation_deps,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc/technical',
+)
+
+foreach article : api_docs + articles
+ custom_target(
+ command: asciidoc_html_options,
+ input: article,
+ output: fs.stem(article) + '.html',
+ depends: documentation_deps,
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc/technical',
+ )
+endforeach
diff --git a/Documentation/user-manual.conf b/Documentation/user-manual.conf
deleted file mode 100644
index 0148f126dc..0000000000
--- a/Documentation/user-manual.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-[titles]
- underlines="__","==","--","~~","^^"
-
-[attributes]
-caret=^
-startsb=&#91;
-endsb=&#93;
-tilde=&#126;
-
-[linkgit-inlinemacro]
-<ulink url="{target}.html">{target}{0?({0})}</ulink>
diff --git a/GIT-BUILD-OPTIONS.in b/GIT-BUILD-OPTIONS.in
new file mode 100644
index 0000000000..edff75ae16
--- /dev/null
+++ b/GIT-BUILD-OPTIONS.in
@@ -0,0 +1,48 @@
+BROKEN_PATH_FIX=@BROKEN_PATH_FIX@
+DIFF=@DIFF@
+FSMONITOR_DAEMON_BACKEND=@FSMONITOR_DAEMON_BACKEND@
+FSMONITOR_OS_SETTINGS=@FSMONITOR_OS_SETTINGS@
+GITWEBDIR=@GITWEBDIR@
+GIT_INTEROP_MAKE_OPTS=@GIT_INTEROP_MAKE_OPTS@
+GIT_PERF_LARGE_REPO=@GIT_PERF_LARGE_REPO@
+GIT_PERF_MAKE_COMMAND=@GIT_PERF_MAKE_COMMAND@
+GIT_PERF_MAKE_OPTS=@GIT_PERF_MAKE_OPTS@
+GIT_PERF_REPEAT_COUNT=@GIT_PERF_REPEAT_COUNT@
+GIT_PERF_REPO=@GIT_PERF_REPO@
+GIT_TEST_CMP=@GIT_TEST_CMP@
+GIT_TEST_CMP_USE_COPIED_CONTEXT=@GIT_TEST_CMP_USE_COPIED_CONTEXT@
+GIT_TEST_GITPERLLIB=@GIT_TEST_GITPERLLIB@
+GIT_TEST_INDEX_VERSION=@GIT_TEST_INDEX_VERSION@
+GIT_TEST_MERGE_TOOLS_DIR=@GIT_TEST_MERGE_TOOLS_DIR@
+GIT_TEST_OPTS=@GIT_TEST_OPTS@
+GIT_TEST_PERL_FATAL_WARNINGS=@GIT_TEST_PERL_FATAL_WARNINGS@
+GIT_TEST_POPATH=@GIT_TEST_POPATH@
+GIT_TEST_TEMPLATE_DIR=@GIT_TEST_TEMPLATE_DIR@
+GIT_TEST_TEXTDOMAINDIR=@GIT_TEST_TEXTDOMAINDIR@
+GIT_TEST_UTF8_LOCALE=@GIT_TEST_UTF8_LOCALE@
+LOCALEDIR=@LOCALEDIR@
+NO_CURL=@NO_CURL@
+NO_EXPAT=@NO_EXPAT@
+NO_GETTEXT=@NO_GETTEXT@
+NO_GITWEB=@NO_GITWEB@
+NO_ICONV=@NO_ICONV@
+NO_PERL=@NO_PERL@
+NO_PERL_CPAN_FALLBACKS=@NO_PERL_CPAN_FALLBACKS@
+NO_PTHREADS=@NO_PTHREADS@
+NO_PYTHON=@NO_PYTHON@
+NO_REGEX=@NO_REGEX@
+NO_UNIX_SOCKETS=@NO_UNIX_SOCKETS@
+PAGER_ENV=@PAGER_ENV@
+PERL_LOCALEDIR=@PERL_LOCALEDIR@
+PERL_PATH=@PERL_PATH@
+PYTHON_PATH=@PYTHON_PATH@
+RUNTIME_PREFIX=@RUNTIME_PREFIX@
+SANITIZE_ADDRESS=@SANITIZE_ADDRESS@
+SANITIZE_LEAK=@SANITIZE_LEAK@
+SHELL_PATH=@SHELL_PATH@
+TAR=@TAR@
+TEST_OUTPUT_DIRECTORY=@TEST_OUTPUT_DIRECTORY@
+TEST_SHELL_PATH=@TEST_SHELL_PATH@
+USE_GETTEXT_SCHEME=@USE_GETTEXT_SCHEME@
+USE_LIBPCRE2=@USE_LIBPCRE2@
+X=@X@
diff --git a/GIT-VERSION-FILE.in b/GIT-VERSION-FILE.in
new file mode 100644
index 0000000000..3789a48a34
--- /dev/null
+++ b/GIT-VERSION-FILE.in
@@ -0,0 +1 @@
+GIT_VERSION=@GIT_VERSION@
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 78e8631f67..3704a1c39e 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,40 +1,96 @@
#!/bin/sh
-GVF=GIT-VERSION-FILE
-DEF_VER=v2.47.GIT
+DEF_VER=v2.48.GIT
LF='
'
-# First see if there is a version file (included in release tarballs),
-# then try git-describe, then default.
-if test -f version
+if test "$#" -ne 3
then
- VN=$(cat version) || VN="$DEF_VER"
-elif { test -d "${GIT_DIR:-.git}" || test -f .git; } &&
- VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) &&
- case "$VN" in
- *$LF*) (exit 1) ;;
- v[0-9]*)
- git update-index -q --refresh
- test -z "$(git diff-index --name-only HEAD --)" ||
- VN="$VN-dirty" ;;
- esac
+ echo >&2 "USAGE: $0 <SOURCE_DIR> <INPUT> <OUTPUT>"
+ exit 1
+fi
+
+SOURCE_DIR="$1"
+INPUT="$2"
+OUTPUT="$3"
+
+if ! test -f "$INPUT"
then
- VN=$(echo "$VN" | sed -e 's/-/./g');
-else
- VN="$DEF_VER"
+ echo >&2 "Input is not a file: $INPUT"
+ exit 1
+fi
+
+# Protect us from reading Git version information outside of the Git directory
+# in case it is not a repository itself, but embedded in an unrelated
+# repository.
+GIT_CEILING_DIRECTORIES="$SOURCE_DIR/.."
+export GIT_CEILING_DIRECTORIES
+
+if test -z "$GIT_VERSION"
+then
+ # First see if there is a version file (included in release tarballs),
+ # then try git-describe, then default.
+ if test -f "$SOURCE_DIR"/version
+ then
+ VN=$(cat "$SOURCE_DIR"/version) || VN="$DEF_VER"
+ elif {
+ test -d "$SOURCE_DIR/.git" ||
+ test -d "${GIT_DIR:-.git}" ||
+ test -f "$SOURCE_DIR"/.git;
+ } &&
+ VN=$(git -C "$SOURCE_DIR" describe --match "v[0-9]*" HEAD 2>/dev/null) &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ v[0-9]*)
+ git -C "$SOURCE_DIR" update-index -q --refresh
+ test -z "$(git -C "$SOURCE_DIR" diff-index --name-only HEAD --)" ||
+ VN="$VN-dirty" ;;
+ esac
+ then
+ VN=$(echo "$VN" | sed -e 's/-/./g');
+ else
+ VN="$DEF_VER"
+ fi
+
+ GIT_VERSION=$(expr "$VN" : v*'\(.*\)')
fi
-VN=$(expr "$VN" : v*'\(.*\)')
+if test -z "$GIT_BUILT_FROM_COMMIT"
+then
+ GIT_BUILT_FROM_COMMIT=$(git -C "$SOURCE_DIR" rev-parse -q --verify HEAD 2>/dev/null)
+fi
+
+if test -z "$GIT_DATE"
+then
+ GIT_DATE=$(git -C "$SOURCE_DIR" show --quiet --format='%as' 2>/dev/null)
+fi
+
+if test -z "$GIT_USER_AGENT"
+then
+ GIT_USER_AGENT="git/$GIT_VERSION"
+fi
+
+# While released Git versions only have three numbers, development builds also
+# have a fourth number that corresponds to the number of patches since the last
+# release.
+read GIT_MAJOR_VERSION GIT_MINOR_VERSION GIT_MICRO_VERSION GIT_PATCH_LEVEL trailing <<EOF
+$(echo "$GIT_VERSION" 0 0 0 0 | tr '.a-zA-Z-' ' ')
+EOF
+
+sed -e "s|@GIT_VERSION@|$GIT_VERSION|" \
+ -e "s|@GIT_MAJOR_VERSION@|$GIT_MAJOR_VERSION|" \
+ -e "s|@GIT_MINOR_VERSION@|$GIT_MINOR_VERSION|" \
+ -e "s|@GIT_MICRO_VERSION@|$GIT_MICRO_VERSION|" \
+ -e "s|@GIT_PATCH_LEVEL@|$GIT_PATCH_LEVEL|" \
+ -e "s|@GIT_BUILT_FROM_COMMIT@|$GIT_BUILT_FROM_COMMIT|" \
+ -e "s|@GIT_USER_AGENT@|$GIT_USER_AGENT|" \
+ -e "s|@GIT_DATE@|$GIT_DATE|" \
+ "$INPUT" >"$OUTPUT".$$+
-if test -r $GVF
+if ! test -f "$OUTPUT" || ! cmp "$OUTPUT".$$+ "$OUTPUT" >/dev/null
then
- VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
+ mv "$OUTPUT".$$+ "$OUTPUT"
else
- VC=unset
+ rm "$OUTPUT".$$+
fi
-test "$VN" = "$VC" || {
- echo >&2 "GIT_VERSION = $VN"
- echo "GIT_VERSION = $VN" >$GVF
-}
diff --git a/Makefile b/Makefile
index 549b24e7fd..2f6e2d5295 100644
--- a/Makefile
+++ b/Makefile
@@ -591,10 +591,6 @@ include shared.mak
#
# Disable -pedantic compilation.
-GIT-VERSION-FILE: FORCE
- @$(SHELL_PATH) ./GIT-VERSION-GEN
--include GIT-VERSION-FILE
-
# Set our default configuration.
#
# Among the variables below, these:
@@ -822,6 +818,7 @@ TEST_BUILTINS_OBJS += test-parse-options.o
TEST_BUILTINS_OBJS += test-parse-pathspec-file.o
TEST_BUILTINS_OBJS += test-partial-clone.o
TEST_BUILTINS_OBJS += test-path-utils.o
+TEST_BUILTINS_OBJS += test-path-walk.o
TEST_BUILTINS_OBJS += test-pcre2-config.o
TEST_BUILTINS_OBJS += test-pkt-line.o
TEST_BUILTINS_OBJS += test-proc-receive.o
@@ -1098,6 +1095,7 @@ LIB_OBJS += parse-options.o
LIB_OBJS += patch-delta.o
LIB_OBJS += patch-ids.o
LIB_OBJS += path.o
+LIB_OBJS += path-walk.o
LIB_OBJS += pathspec.o
LIB_OBJS += pkt-line.o
LIB_OBJS += preload-index.o
@@ -1341,21 +1339,22 @@ THIRD_PARTY_SOURCES += sha1dc/%
THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/%
THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/clar/%
-CLAR_TEST_SUITES += ctype
-CLAR_TEST_SUITES += strvec
+CLAR_TEST_SUITES += u-ctype
+CLAR_TEST_SUITES += u-hash
+CLAR_TEST_SUITES += u-mem-pool
+CLAR_TEST_SUITES += u-prio-queue
+CLAR_TEST_SUITES += u-reftable-tree
+CLAR_TEST_SUITES += u-strvec
CLAR_TEST_PROG = $(UNIT_TEST_BIN)/unit-tests$(X)
CLAR_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(CLAR_TEST_SUITES))
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/clar/clar.o
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o
UNIT_TEST_PROGRAMS += t-example-decorate
-UNIT_TEST_PROGRAMS += t-hash
UNIT_TEST_PROGRAMS += t-hashmap
-UNIT_TEST_PROGRAMS += t-mem-pool
UNIT_TEST_PROGRAMS += t-oid-array
UNIT_TEST_PROGRAMS += t-oidmap
UNIT_TEST_PROGRAMS += t-oidtree
-UNIT_TEST_PROGRAMS += t-prio-queue
UNIT_TEST_PROGRAMS += t-reftable-basics
UNIT_TEST_PROGRAMS += t-reftable-block
UNIT_TEST_PROGRAMS += t-reftable-merged
@@ -1364,7 +1363,6 @@ UNIT_TEST_PROGRAMS += t-reftable-reader
UNIT_TEST_PROGRAMS += t-reftable-readwrite
UNIT_TEST_PROGRAMS += t-reftable-record
UNIT_TEST_PROGRAMS += t-reftable-stack
-UNIT_TEST_PROGRAMS += t-reftable-tree
UNIT_TEST_PROGRAMS += t-strbuf
UNIT_TEST_PROGRAMS += t-strcmp-offset
UNIT_TEST_PROGRAMS += t-trailer
@@ -1462,6 +1460,18 @@ ifdef DEVELOPER
include config.mak.dev
endif
+GIT-VERSION-FILE: FORCE
+ @OLD=$$(cat $@ 2>/dev/null || :) && \
+ $(call version_gen,"$(shell pwd)",GIT-VERSION-FILE.in,$@) && \
+ NEW=$$(cat $@ 2>/dev/null || :) && \
+ if test "$$OLD" != "$$NEW"; then echo "$$NEW" >&2; fi
+
+# We need to set GIT_VERSION_OVERRIDE before including the version file as
+# otherwise any user-provided value for GIT_VERSION would have been overridden
+# already.
+GIT_VERSION_OVERRIDE := $(GIT_VERSION)
+-include GIT-VERSION-FILE
+
# what 'all' will build and 'install' will install in gitexecdir,
# excluding programs for built-in commands
ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
@@ -1487,7 +1497,6 @@ ifneq ($(filter undefined,$(SANITIZERS)),)
BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS
endif
ifneq ($(filter leak,$(SANITIZERS)),)
-BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
BASIC_CFLAGS += -O0
SANITIZE_LEAK = YesCompiledWithIt
endif
@@ -1555,10 +1564,10 @@ endif
ifdef SANE_TOOL_PATH
SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
-BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix "$(SANE_TOOL_PATH_SQ)"|'
+BROKEN_PATH_FIX = s|^\# @BROKEN_PATH_FIX@$$|git_broken_path_fix "$(SANE_TOOL_PATH_SQ)"|
PATH := $(SANE_TOOL_PATH):${PATH}
else
-BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
+BROKEN_PATH_FIX = /^\# @BROKEN_PATH_FIX@$$/d
endif
ifeq (,$(HOST_CPU))
@@ -2422,9 +2431,12 @@ endif
FUZZ_OBJS += oss-fuzz/dummy-cmd-main.o
FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
FUZZ_OBJS += oss-fuzz/fuzz-config.o
+FUZZ_OBJS += oss-fuzz/fuzz-credential-from-url-gently.o
FUZZ_OBJS += oss-fuzz/fuzz-date.o
FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
+FUZZ_OBJS += oss-fuzz/fuzz-parse-attr-line.o
+FUZZ_OBJS += oss-fuzz/fuzz-url-decode-mem.o
.PHONY: fuzz-objs
fuzz-objs: $(FUZZ_OBJS)
@@ -2505,13 +2517,10 @@ PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))
pager.sp pager.s pager.o: EXTRA_CPPFLAGS = \
-DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
-version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT
-version.sp version.s version.o: EXTRA_CPPFLAGS = \
- '-DGIT_VERSION="$(GIT_VERSION)"' \
- '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' \
- '-DGIT_BUILT_FROM_COMMIT="$(shell \
- GIT_CEILING_DIRECTORIES="$(CURDIR)/.." \
- git rev-parse -q --verify HEAD 2>/dev/null)"'
+version-def.h: version-def.h.in GIT-VERSION-GEN GIT-VERSION-FILE GIT-USER-AGENT
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)",$<,$@)
+
+version.sp version.s version.o: version-def.h
$(BUILT_INS): git$X
$(QUIET_BUILT_IN)$(RM) $@ && \
@@ -2522,17 +2531,17 @@ $(BUILT_INS): git$X
config-list.h: generate-configlist.sh
config-list.h: Documentation/*config.txt Documentation/config/*.txt
- $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh >$@
+ $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@
command-list.h: generate-cmdlist.sh command-list.txt
command-list.h: $(wildcard Documentation/git*.txt)
$(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
$(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
- command-list.txt >$@
+ . $@
hook-list.h: generate-hooklist.sh Documentation/githooks.txt
- $(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh >$@
+ $(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh . $@
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\
$(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
@@ -2545,33 +2554,15 @@ GIT-SCRIPT-DEFINES: FORCE
echo "$$FLAGS" >$@; \
fi
-define cmd_munge_script
-sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
- -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
- -e 's|@@DIFF@@|$(DIFF_SQ)|' \
- -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
- -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
- -e $(BROKEN_PATH_FIX) \
- -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
- -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
- -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \
- $@.sh >$@+
-endef
-
-$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
- $(QUIET_GEN)$(cmd_munge_script) && \
- chmod +x $@+ && \
+$(SCRIPT_SH_GEN) $(SCRIPT_LIB) : % : %.sh generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
+ $(QUIET_GEN)./generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
mv $@+ $@
-$(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
- $(QUIET_GEN)$(cmd_munge_script) && \
- mv $@+ $@
+git.rc: git.rc.in GIT-VERSION-GEN GIT-VERSION-FILE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)",$<,$@)
-git.res: git.rc GIT-VERSION-FILE GIT-PREFIX
- $(QUIET_RC)$(RC) \
- $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \
- $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \
- -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@
+git.res: git.rc GIT-PREFIX
+ $(QUIET_RC)$(RC) -i $< -o $@
# This makes sure we depend on the NO_PERL setting itself.
$(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
@@ -2604,16 +2595,8 @@ endif
PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)
-$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
- $(QUIET_GEN) \
- sed -e '1{' \
- -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
- -e ' r GIT-PERL-HEADER' \
- -e ' G' \
- -e '}' \
- -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
- $< >$@+ && \
- chmod +x $@+ && \
+$(SCRIPT_PERL_GEN): % : %.perl generate-perl.sh GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
+ $(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@+" && \
mv $@+ $@
PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))
@@ -2629,11 +2612,11 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
INSTLIBDIR='$(perllibdir_SQ)' && \
INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \
- sed -e 's=@@PATHSEP@@=$(pathsep)=g' \
- -e "s=@@INSTLIBDIR@@=$$INSTLIBDIR=g" \
- -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \
- -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \
- -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \
+ sed -e 's=@PATHSEP@=$(pathsep)=g' \
+ -e "s=@INSTLIBDIR@=$$INSTLIBDIR=g" \
+ -e 's=@PERLLIBDIR_REL@=$(perllibdir_relative_SQ)=g' \
+ -e 's=@GITEXECDIR_REL@=$(gitexecdir_relative_SQ)=g' \
+ -e 's=@LOCALEDIR_REL@=$(localedir_relative_SQ)=g' \
$< >$@+ && \
mv $@+ $@
@@ -2641,15 +2624,15 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
perllibdir:
@echo '$(perllibdir_SQ)'
-git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES
- $(QUIET_GEN)$(cmd_munge_script) && \
+git-instaweb: git-instaweb.sh generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
+ $(QUIET_GEN)./generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
chmod +x $@+ && \
mv $@+ $@
else # NO_PERL
$(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh
$(QUIET_GEN) \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
- -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
+ -e 's|@REASON@|NO_PERL=$(NO_PERL)|g' \
unimplemented.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
@@ -2659,24 +2642,20 @@ endif # NO_PERL
$(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS
ifndef NO_PYTHON
-$(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS
+$(SCRIPT_PYTHON_GEN): generate-python.sh
$(SCRIPT_PYTHON_GEN): % : %.py
- $(QUIET_GEN) \
- sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
- $< >$@+ && \
- chmod +x $@+ && \
- mv $@+ $@
+ $(QUIET_GEN)$(SHELL_PATH) generate-python.sh ./GIT-BUILD-OPTIONS "$<" "$@"
else # NO_PYTHON
$(SCRIPT_PYTHON_GEN): % : unimplemented.sh
$(QUIET_GEN) \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
- -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \
+ -e 's|@REASON@|NO_PYTHON=$(NO_PYTHON)|g' \
unimplemented.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
endif # NO_PYTHON
-CONFIGURE_RECIPE = sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+CONFIGURE_RECIPE = sed -e 's/@GIT_VERSION@/$(GIT_VERSION)/g' \
configure.ac >configure.ac+ && \
autoconf -o configure configure.ac+ && \
$(RM) configure.ac+
@@ -2722,6 +2701,7 @@ REFTABLE_OBJS += reftable/pq.o
REFTABLE_OBJS += reftable/reader.o
REFTABLE_OBJS += reftable/record.o
REFTABLE_OBJS += reftable/stack.o
+REFTABLE_OBJS += reftable/system.o
REFTABLE_OBJS += reftable/tree.o
REFTABLE_OBJS += reftable/writer.o
@@ -3101,13 +3081,9 @@ endif
NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS))
endif
-perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES
+perl/build/lib/%.pm: perl/%.pm generate-perl.sh GIT-BUILD-OPTIONS GIT-VERSION-FILE GIT-PERL-DEFINES
$(call mkdir_p_parent_template)
- $(QUIET_GEN) \
- sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \
- -e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \
- -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \
- < $< > $@
+ $(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@"
perl/build/man/man3/Git.3pm: perl/Git.pm
$(call mkdir_p_parent_template)
@@ -3160,80 +3136,67 @@ GIT-LDFLAGS: FORCE
echo "$$FLAGS" >GIT-LDFLAGS; \
fi
+ifdef RUNTIME_PREFIX
+RUNTIME_PREFIX_OPTION = true
+else
+RUNTIME_PREFIX_OPTION = false
+endif
+
# We need to apply sq twice, once to protect from the shell
# that runs GIT-BUILD-OPTIONS, and then again to protect it
# and the first level quoting from the shell that runs "echo".
GIT-BUILD-OPTIONS: FORCE
- @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+
- @echo TEST_SHELL_PATH=\''$(subst ','\'',$(TEST_SHELL_PATH_SQ))'\' >>$@+
- @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+
- @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+
- @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+
- @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
- @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
- @echo NO_ICONV=\''$(subst ','\'',$(subst ','\'',$(NO_ICONV)))'\' >>$@+
- @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
- @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+
- @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
- @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+
- @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
- @echo NO_REGEX=\''$(subst ','\'',$(subst ','\'',$(NO_REGEX)))'\' >>$@+
- @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
- @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
- @echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+
- @echo SANITIZE_ADDRESS=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_ADDRESS)))'\' >>$@+
- @echo X=\'$(X)\' >>$@+
-ifdef FSMONITOR_DAEMON_BACKEND
- @echo FSMONITOR_DAEMON_BACKEND=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_DAEMON_BACKEND)))'\' >>$@+
-endif
-ifdef FSMONITOR_OS_SETTINGS
- @echo FSMONITOR_OS_SETTINGS=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_OS_SETTINGS)))'\' >>$@+
-endif
-ifdef TEST_OUTPUT_DIRECTORY
- @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
-endif
-ifdef GIT_TEST_OPTS
- @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+
-endif
-ifdef GIT_TEST_CMP
- @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+
-endif
-ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
- @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+
-endif
-ifdef GIT_TEST_UTF8_LOCALE
- @echo GIT_TEST_UTF8_LOCALE=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_UTF8_LOCALE)))'\' >>$@+
-endif
- @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+
-ifdef GIT_PERF_REPEAT_COUNT
- @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+
-endif
-ifdef GIT_PERF_REPO
- @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+
-endif
-ifdef GIT_PERF_LARGE_REPO
- @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+
-endif
-ifdef GIT_PERF_MAKE_OPTS
- @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+
-endif
-ifdef GIT_PERF_MAKE_COMMAND
- @echo GIT_PERF_MAKE_COMMAND=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_COMMAND)))'\' >>$@+
-endif
-ifdef GIT_INTEROP_MAKE_OPTS
- @echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+
-endif
-ifdef GIT_TEST_INDEX_VERSION
- @echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+
-endif
-ifdef GIT_TEST_PERL_FATAL_WARNINGS
- @echo GIT_TEST_PERL_FATAL_WARNINGS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PERL_FATAL_WARNINGS)))'\' >>$@+
-endif
-ifdef RUNTIME_PREFIX
- @echo RUNTIME_PREFIX=\'true\' >>$@+
-else
- @echo RUNTIME_PREFIX=\'false\' >>$@+
-endif
+ @sed \
+ -e "s!@BROKEN_PATH_FIX@!\'$(BROKEN_PATH_FIX)\'!" \
+ -e "s|@DIFF@|\'$(DIFF)\'|" \
+ -e "s|@FSMONITOR_DAEMON_BACKEND@|\'$(FSMONITOR_DAEMON_BACKEND)\'|" \
+ -e "s|@FSMONITOR_OS_SETTINGS@|\'$(FSMONITOR_OS_SETTINGS)\'|" \
+ -e "s|@GITWEBDIR@|\'$(gitwebdir_SQ)\'|" \
+ -e "s|@GIT_INTEROP_MAKE_OPTS@|\'$(GIT_INTEROP_MAKE_OPTS)\'|" \
+ -e "s|@GIT_PERF_LARGE_REPO@|\'$(GIT_PERF_LARGE_REPO)\'|" \
+ -e "s|@GIT_PERF_MAKE_COMMAND@|\'$(GIT_PERF_MAKE_COMMAND)\'|" \
+ -e "s|@GIT_PERF_MAKE_OPTS@|\'$(GIT_PERF_MAKE_OPTS)\'|" \
+ -e "s|@GIT_PERF_REPEAT_COUNT@|\'$(GIT_PERF_REPEAT_COUNT)\'|" \
+ -e "s|@GIT_PERF_REPO@|\'$(GIT_PERF_REPO)\'|" \
+ -e "s|@GIT_TEST_CMP@|\'$(GIT_TEST_CMP)\'|" \
+ -e "s|@GIT_TEST_CMP_USE_COPIED_CONTEXT@|\'$(GIT_TEST_CMP_USE_COPIED_CONTEXT)\'|" \
+ -e "s|@GIT_TEST_GITPERLLIB@|\'$(shell pwd)/perl/build/lib\'|" \
+ -e "s|@GIT_TEST_INDEX_VERSION@|\'$(GIT_TEST_INDEX_VERSION)\'|" \
+ -e "s|@GIT_TEST_MERGE_TOOLS_DIR@|\'$(shell pwd)/mergetools\'|" \
+ -e "s|@GIT_TEST_OPTS@|\'$(GIT_TEST_OPTS)\'|" \
+ -e "s|@GIT_TEST_PERL_FATAL_WARNINGS@|\'$(GIT_TEST_PERL_FATAL_WARNINGS)\'|" \
+ -e "s|@GIT_TEST_POPATH@|\'$(shell pwd)/po\'|" \
+ -e "s|@GIT_TEST_TEMPLATE_DIR@|\'$(shell pwd)/templates/blt\'|" \
+ -e "s|@GIT_TEST_TEXTDOMAINDIR@|\'$(shell pwd)/po/build/locale\'|" \
+ -e "s|@GIT_TEST_UTF8_LOCALE@|\'$(GIT_TEST_UTF8_LOCALE)\'|" \
+ -e "s|@LOCALEDIR@|\'$(localedir_SQ)\'|" \
+ -e "s|@NO_CURL@|\'$(NO_CURL)\'|" \
+ -e "s|@NO_EXPAT@|\'$(NO_EXPAT)\'|" \
+ -e "s|@NO_GETTEXT@|\'$(NO_GETTEXT)\'|" \
+ -e "s|@NO_GITWEB@|\'$(NO_GITWEB)\'|" \
+ -e "s|@NO_ICONV@|\'$(NO_ICONV)\'|" \
+ -e "s|@NO_PERL@|\'$(NO_PERL)\'|" \
+ -e "s|@NO_PERL_CPAN_FALLBACKS@|\'$(NO_PERL_CPAN_FALLBACKS_SQ)\'|" \
+ -e "s|@NO_PTHREADS@|\'$(NO_PTHREADS)\'|" \
+ -e "s|@NO_PYTHON@|\'$(NO_PYTHON)\'|" \
+ -e "s|@NO_REGEX@|\'$(NO_REGEX)\'|" \
+ -e "s|@NO_UNIX_SOCKETS@|\'$(NO_UNIX_SOCKETS)\'|" \
+ -e "s|@PAGER_ENV@|\'$(PAGER_ENV)\'|" \
+ -e "s|@PERL_LOCALEDIR@|\'$(perl_localedir_SQ)\'|" \
+ -e "s|@PERL_PATH@|\'$(PERL_PATH_SQ)\'|" \
+ -e "s|@PYTHON_PATH@|\'$(PYTHON_PATH_SQ)\'|" \
+ -e "s|@RUNTIME_PREFIX@|\'$(RUNTIME_PREFIX_OPTION)\'|" \
+ -e "s|@SANITIZE_ADDRESS@|\'$(SANITIZE_ADDRESS)\'|" \
+ -e "s|@SANITIZE_LEAK@|\'$(SANITIZE_LEAK)\'|" \
+ -e "s|@SHELL_PATH@|\'$(SHELL_PATH_SQ)\'|" \
+ -e "s|@TAR@|\'$(TAR)\'|" \
+ -e "s|@TEST_OUTPUT_DIRECTORY@|\'$(TEST_OUTPUT_DIRECTORY)\'|" \
+ -e "s|@TEST_SHELL_PATH@|\'$(TEST_SHELL_PATH_SQ)\'|" \
+ -e "s|@USE_GETTEXT_SCHEME@|\'$(USE_GETTEXT_SCHEME)\'|" \
+ -e "s|@USE_LIBPCRE2@|\'$(USE_LIBPCRE2)\'|" \
+ -e "s|@X@|\'$(X)\'|" \
+ GIT-BUILD-OPTIONS.in >$@+
+ @if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
@if test -f GIT-BUILD-DIR; then rm GIT-BUILD-DIR; fi
@@ -3253,11 +3216,14 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(
all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG)
-bin-wrappers/%: wrap-for-bin.sh
- $(call mkdir_p_parent_template)
+$(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
- -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
- -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
+ -e 's|@BUILD_DIR@|$(shell pwd)|' \
+ -e 's|@GIT_TEXTDOMAINDIR@|$(shell pwd)/po/build/locale|' \
+ -e 's|@GITPERLLIB@|$(shell pwd)/perl/build/lib|' \
+ -e 's|@MERGE_TOOLS_DIR@|$(shell pwd)/mergetools|' \
+ -e 's|@TEMPLATE_DIR@|$(shell pwd)/templates/blt|' \
+ -e 's|@PROG@|$(shell pwd)/$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
chmod +x $@
# GNU make supports exporting all variables by "export" without parameters.
@@ -3741,7 +3707,7 @@ clean: profile-clean coverage-clean cocciclean
$(RM) -r .build $(UNIT_TEST_BIN)
$(RM) GIT-TEST-SUITES
$(RM) po/git.pot po/git-core.pot
- $(RM) git.res
+ $(RM) git.rc git.res
$(RM) $(OBJECTS)
$(RM) headless-git.o
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)
@@ -3750,7 +3716,9 @@ clean: profile-clean coverage-clean cocciclean
$(RM) $(FUZZ_PROGRAMS)
$(RM) $(SP_OBJ)
$(RM) $(HCC)
- $(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
+ $(RM) version-def.h
+ $(RM) -r $(dep_dirs) $(compdb_dir) compile_commands.json
+ $(RM) $(test_bindir_programs)
$(RM) -r po/build/
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
$(RM) -r .dist-tmp-dir .doc-tmp-dir
diff --git a/RelNotes b/RelNotes
index 061d699283..978481996e 120000
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/2.48.0.txt \ No newline at end of file
+Documentation/RelNotes/2.49.0.txt \ No newline at end of file
diff --git a/add-interactive.c b/add-interactive.c
index 49042b3026..97ff35b6f1 100644
--- a/add-interactive.c
+++ b/add-interactive.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "add-interactive.h"
@@ -71,14 +71,14 @@ void init_add_i_state(struct add_i_state *s, struct repository *r)
s->use_color ? GIT_COLOR_RESET : "", COLOR_MAXLEN);
FREE_AND_NULL(s->interactive_diff_filter);
- git_config_get_string("interactive.difffilter",
- &s->interactive_diff_filter);
+ repo_config_get_string(r, "interactive.difffilter",
+ &s->interactive_diff_filter);
FREE_AND_NULL(s->interactive_diff_algorithm);
- git_config_get_string("diff.algorithm",
- &s->interactive_diff_algorithm);
+ repo_config_get_string(r, "diff.algorithm",
+ &s->interactive_diff_algorithm);
- git_config_get_bool("interactive.singlekey", &s->use_single_key);
+ repo_config_get_bool(r, "interactive.singlekey", &s->use_single_key);
if (s->use_single_key)
setbuf(stdin, NULL);
}
@@ -534,7 +534,7 @@ static int get_modified_files(struct repository *r,
size_t *binary_count)
{
struct object_id head_oid;
- int is_initial = !refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
+ int is_initial = !refs_resolve_ref_unsafe(get_main_ref_store(r),
"HEAD", RESOLVE_REF_READING,
&head_oid, NULL);
struct collection_status s = { 0 };
@@ -559,7 +559,7 @@ static int get_modified_files(struct repository *r,
s.skip_unseen = filter && i;
opt.def = is_initial ?
- empty_tree_oid_hex(the_repository->hash_algo) : oid_to_hex(&head_oid);
+ empty_tree_oid_hex(r->hash_algo) : oid_to_hex(&head_oid);
repo_init_revisions(r, &rev, NULL);
setup_revisions(0, NULL, &rev, &opt);
@@ -764,7 +764,7 @@ static int run_revert(struct add_i_state *s, const struct pathspec *ps,
size_t count, i, j;
struct object_id oid;
- int is_initial = !refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
+ int is_initial = !refs_resolve_ref_unsafe(get_main_ref_store(s->r),
"HEAD", RESOLVE_REF_READING,
&oid,
NULL);
@@ -995,7 +995,7 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,
ssize_t count, i;
struct object_id oid;
- int is_initial = !refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
+ int is_initial = !refs_resolve_ref_unsafe(get_main_ref_store(s->r),
"HEAD", RESOLVE_REF_READING,
&oid,
NULL);
diff --git a/add-patch.c b/add-patch.c
index 557903310d..95c67d8c80 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "add-interactive.h"
@@ -1463,7 +1464,7 @@ static int patch_update_file(struct add_p_state *s,
if (file_diff->hunk_nr) {
if (rendered_hunk_index != hunk_index) {
if (use_pager) {
- setup_pager();
+ setup_pager(the_repository);
sigchain_push(SIGPIPE, SIG_IGN);
}
render_hunk(s, hunk, 0, colored, &s->buf);
diff --git a/advice.c b/advice.c
index 6b879d805c..1df43b7536 100644
--- a/advice.c
+++ b/advice.c
@@ -53,6 +53,7 @@ static struct {
[ADVICE_COMMIT_BEFORE_MERGE] = { "commitBeforeMerge" },
[ADVICE_DETACHED_HEAD] = { "detachedHead" },
[ADVICE_DIVERGING] = { "diverging" },
+ [ADVICE_FETCH_SET_HEAD_WARN] = { "fetchRemoteHEADWarn" },
[ADVICE_FETCH_SHOW_FORCED_UPDATES] = { "fetchShowForcedUpdates" },
[ADVICE_FORCE_DELETE_BRANCH] = { "forceDeleteBranch" },
[ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated" },
@@ -93,7 +94,7 @@ static struct {
static const char turn_off_instructions[] =
N_("\n"
- "Disable this message with \"git config advice.%s false\"");
+ "Disable this message with \"git config set advice.%s false\"");
static void vadvise(const char *advice, int display_instructions,
const char *key, va_list params)
@@ -160,7 +161,6 @@ void advise_if_enabled(enum advice_type type, const char *advice, ...)
int git_default_advice_config(const char *var, const char *value)
{
const char *k, *slot_name;
- int i;
if (!strcmp(var, "color.advice")) {
advice_use_color = git_config_colorbool(var, value);
@@ -179,7 +179,7 @@ int git_default_advice_config(const char *var, const char *value)
if (!skip_prefix(var, "advice.", &k))
return 0;
- for (i = 0; i < ARRAY_SIZE(advice_setting); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(advice_setting); i++) {
if (strcasecmp(k, advice_setting[i].key))
continue;
advice_setting[i].level = git_config_bool(var, value)
@@ -193,9 +193,7 @@ int git_default_advice_config(const char *var, const char *value)
void list_config_advices(struct string_list *list, const char *prefix)
{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(advice_setting); i++)
+ for (size_t i = 0; i < ARRAY_SIZE(advice_setting); i++)
list_config_item(list, prefix, advice_setting[i].key);
}
diff --git a/advice.h b/advice.h
index d7466bc0ef..cf2284ec43 100644
--- a/advice.h
+++ b/advice.h
@@ -20,6 +20,7 @@ enum advice_type {
ADVICE_COMMIT_BEFORE_MERGE,
ADVICE_DETACHED_HEAD,
ADVICE_DIVERGING,
+ ADVICE_FETCH_SET_HEAD_WARN,
ADVICE_FETCH_SHOW_FORCED_UPDATES,
ADVICE_FORCE_DELETE_BRANCH,
ADVICE_GRAFT_FILE_DEPRECATED,
diff --git a/apply.c b/apply.c
index a3fc2d5330..4a7b6120ac 100644
--- a/apply.c
+++ b/apply.c
@@ -8,6 +8,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
diff --git a/archive.c b/archive.c
index a7a92ff839..b9c200cba6 100644
--- a/archive.c
+++ b/archive.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
diff --git a/attr.c b/attr.c
index c605d2c170..0bd2750528 100644
--- a/attr.c
+++ b/attr.c
@@ -7,6 +7,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -259,42 +260,6 @@ const struct git_attr *git_attr(const char *name)
return git_attr_internal(name, strlen(name));
}
-/* What does a matched pattern decide? */
-struct attr_state {
- const struct git_attr *attr;
- const char *setto;
-};
-
-struct pattern {
- const char *pattern;
- int patternlen;
- int nowildcardlen;
- unsigned flags; /* PATTERN_FLAG_* */
-};
-
-/*
- * One rule, as from a .gitattributes file.
- *
- * If is_macro is true, then u.attr is a pointer to the git_attr being
- * defined.
- *
- * If is_macro is false, then u.pat is the filename pattern to which the
- * rule applies.
- *
- * In either case, num_attr is the number of attributes affected by
- * this rule, and state is an array listing them. The attributes are
- * listed as they appear in the file (macros unexpanded).
- */
-struct match_attr {
- union {
- struct pattern pat;
- const struct git_attr *attr;
- } u;
- char is_macro;
- size_t num_attr;
- struct attr_state state[FLEX_ARRAY];
-};
-
static const char blank[] = " \t\r\n";
/* Flags usable in read_attr() and parse_attr_line() family of functions. */
@@ -353,8 +318,8 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
return ep + strspn(ep, blank);
}
-static struct match_attr *parse_attr_line(const char *line, const char *src,
- int lineno, unsigned flags)
+struct match_attr *parse_attr_line(const char *line, const char *src,
+ int lineno, unsigned flags)
{
size_t namelen, num_attr, i;
const char *cp, *name, *states;
diff --git a/attr.h b/attr.h
index bb33b60880..a04a521092 100644
--- a/attr.h
+++ b/attr.h
@@ -240,4 +240,47 @@ int git_attr_system_is_enabled(void);
extern char *git_attr_tree;
+/*
+ * Exposed for fuzz-testing only.
+ */
+
+/* What does a matched pattern decide? */
+struct attr_state {
+ const struct git_attr *attr;
+ const char *setto;
+};
+
+struct pattern {
+ const char *pattern;
+ int patternlen;
+ int nowildcardlen;
+ unsigned flags; /* PATTERN_FLAG_* */
+};
+
+/*
+ * One rule, as from a .gitattributes file.
+ *
+ * If is_macro is true, then u.attr is a pointer to the git_attr being
+ * defined.
+ *
+ * If is_macro is false, then u.pat is the filename pattern to which the
+ * rule applies.
+ *
+ * In either case, num_attr is the number of attributes affected by
+ * this rule, and state is an array listing them. The attributes are
+ * listed as they appear in the file (macros unexpanded).
+ */
+struct match_attr {
+ union {
+ struct pattern pat;
+ const struct git_attr *attr;
+ } u;
+ char is_macro;
+ size_t num_attr;
+ struct attr_state state[FLEX_ARRAY];
+};
+
+struct match_attr *parse_attr_line(const char *line, const char *src,
+ int lineno, unsigned flags);
+
#endif /* ATTR_H */
diff --git a/base85.c b/base85.c
index bbacdca31b..80e899a2b1 100644
--- a/base85.c
+++ b/base85.c
@@ -29,10 +29,9 @@ static const char en85[] = {
static char de85[256];
static void prep_base85(void)
{
- int i;
if (de85['Z'])
return;
- for (i = 0; i < ARRAY_SIZE(en85); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(en85); i++) {
int ch = en85[i];
de85[ch] = i + 1;
}
diff --git a/bin-wrappers/.gitignore b/bin-wrappers/.gitignore
new file mode 100644
index 0000000000..1c6c90458b
--- /dev/null
+++ b/bin-wrappers/.gitignore
@@ -0,0 +1,9 @@
+/git
+/git-cvsserver
+/git-receive-pack
+/git-shell
+/git-upload-archive
+/git-upload-pack
+/scalar
+/test-fake-ssh
+/test-tool
diff --git a/bin-wrappers/meson.build b/bin-wrappers/meson.build
new file mode 100644
index 0000000000..8a4e910c9b
--- /dev/null
+++ b/bin-wrappers/meson.build
@@ -0,0 +1,28 @@
+bin_wrappers_config = configuration_data()
+foreach key, value : {
+ 'BUILD_DIR': meson.project_build_root(),
+ 'MERGE_TOOLS_DIR': meson.project_source_root() / 'mergetools',
+ 'TEMPLATE_DIR': meson.project_build_root() / 'templates',
+ 'GIT_TEXTDOMAINDIR': meson.project_build_root() / 'po',
+ 'GITPERLLIB': meson.project_build_root() / 'perl/lib',
+}
+ # Paths need to be Unix-style without drive prefixes as they get added to the
+ # PATH variable. And given that drive prefixes contain a colon we'd otherwise
+ # end up with a broken PATH if we didn't convert them.
+ if cygpath.found()
+ value = run_command(cygpath, value, check: true).stdout().strip()
+ endif
+ bin_wrappers_config.set(key, value)
+endforeach
+
+foreach executable : bin_wrappers
+ executable_config = configuration_data()
+ executable_config.merge_from(bin_wrappers_config)
+ executable_config.set('PROG', executable.full_path())
+
+ configure_file(
+ input: 'wrap-for-bin.sh',
+ output: fs.stem(executable.full_path()),
+ configuration: executable_config,
+ )
+endforeach
diff --git a/bin-wrappers/wrap-for-bin.sh b/bin-wrappers/wrap-for-bin.sh
new file mode 100755
index 0000000000..4b658ffd2d
--- /dev/null
+++ b/bin-wrappers/wrap-for-bin.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# wrap-for-bin.sh: Template for git executable wrapper scripts
+# to run test suite against sandbox, but with only bindir-installed
+# executables in PATH. The Makefile copies this into various
+# files in bin-wrappers, substituting
+# @BUILD_DIR@, @TEMPLATE_DIR@ and @PROG@.
+
+GIT_EXEC_PATH='@BUILD_DIR@'
+if test -n "$NO_SET_GIT_TEMPLATE_DIR"
+then
+ unset GIT_TEMPLATE_DIR
+else
+ GIT_TEMPLATE_DIR='@TEMPLATE_DIR@'
+ export GIT_TEMPLATE_DIR
+fi
+MERGE_TOOLS_DIR='@MERGE_TOOLS_DIR@'
+GITPERLLIB='@GITPERLLIB@'"${GITPERLLIB:+:$GITPERLLIB}"
+GIT_TEXTDOMAINDIR='@GIT_TEXTDOMAINDIR@'
+PATH='@BUILD_DIR@/bin-wrappers:'"$PATH"
+
+export MERGE_TOOLS_DIR GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
+
+case "$GIT_DEBUGGER" in
+'')
+ exec "@PROG@" "$@"
+ ;;
+1)
+ unset GIT_DEBUGGER
+ exec gdb --args "@PROG@" "$@"
+ ;;
+*)
+ GIT_DEBUGGER_ARGS="$GIT_DEBUGGER"
+ unset GIT_DEBUGGER
+ exec ${GIT_DEBUGGER_ARGS} "@PROG@" "$@"
+ ;;
+esac
diff --git a/bisect.c b/bisect.c
index d71c4e4b44..7a3c77c6d8 100644
--- a/bisect.c
+++ b/bisect.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -779,10 +780,10 @@ static struct commit *get_commit_reference(struct repository *r,
}
static struct commit **get_bad_and_good_commits(struct repository *r,
- int *rev_nr)
+ size_t *rev_nr)
{
struct commit **rev;
- int i, n = 0;
+ size_t i, n = 0;
ALLOC_ARRAY(rev, 1 + good_revs.nr);
rev[n++] = get_commit_reference(r, current_bad_oid);
@@ -854,7 +855,7 @@ static void handle_skipped_merge_base(const struct object_id *mb)
* for early success, this will be converted back to 0 in
* check_good_are_ancestors_of_bad().
*/
-static enum bisect_error check_merge_bases(int rev_nr, struct commit **rev, int no_checkout)
+static enum bisect_error check_merge_bases(size_t rev_nr, struct commit **rev, int no_checkout)
{
enum bisect_error res = BISECT_OK;
struct commit_list *result = NULL;
@@ -886,7 +887,7 @@ static enum bisect_error check_merge_bases(int rev_nr, struct commit **rev, int
return res;
}
-static int check_ancestors(struct repository *r, int rev_nr,
+static int check_ancestors(struct repository *r, size_t rev_nr,
struct commit **rev, const char *prefix)
{
struct strvec rev_argv = STRVEC_INIT;
@@ -921,7 +922,8 @@ static enum bisect_error check_good_are_ancestors_of_bad(struct repository *r,
{
char *filename;
struct stat st;
- int fd, rev_nr;
+ int fd;
+ size_t rev_nr;
enum bisect_error res = BISECT_OK;
struct commit **rev;
diff --git a/blame.c b/blame.c
index bf69768a7d..a15ddf9333 100644
--- a/blame.c
+++ b/blame.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "refs.h"
diff --git a/bloom.c b/bloom.c
index c428634105..0c8d2cebf9 100644
--- a/bloom.c
+++ b/bloom.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "bloom.h"
#include "diff.h"
diff --git a/branch.c b/branch.c
index ebaa870c01..77716966fe 100644
--- a/branch.c
+++ b/branch.c
@@ -372,7 +372,7 @@ int read_branch_desc(struct strbuf *buf, const char *branch_name)
*/
int validate_branchname(const char *name, struct strbuf *ref)
{
- if (strbuf_check_branch_ref(ref, name)) {
+ if (check_branch_ref(ref, name)) {
int code = die_message(_("'%s' is not a valid branch name"), name);
advise_if_enabled(ADVICE_REF_SYNTAX,
_("See `man git check-ref-format`"));
diff --git a/builtin/add.c b/builtin/add.c
index 7d35307792..78dfb26577 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2006 Linus Torvalds
*/
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -39,9 +40,9 @@ static int chmod_pathspec(struct repository *repo,
char flip,
int show_only)
{
- int i, ret = 0;
+ int ret = 0;
- for (i = 0; i < repo->index->cache_nr; i++) {
+ for (size_t i = 0; i < repo->index->cache_nr; i++) {
struct cache_entry *ce = repo->index->cache[i];
int err;
@@ -69,9 +70,9 @@ static int renormalize_tracked_files(struct repository *repo,
const struct pathspec *pathspec,
int flags)
{
- int i, retval = 0;
+ int retval = 0;
- for (i = 0; i < repo->index->cache_nr; i++) {
+ for (size_t i = 0; i < repo->index->cache_nr; i++) {
struct cache_entry *ce = repo->index->cache[i];
if (!include_sparse &&
diff --git a/builtin/am.c b/builtin/am.c
index bfa95147cf..390b463144 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
@@ -1210,7 +1211,7 @@ static int parse_mail(struct am_state *state, const char *mail)
int ret = 0;
struct mailinfo mi;
- setup_mailinfo(&mi);
+ setup_mailinfo(the_repository, &mi);
if (state->utf8)
mi.metainfo_charset = get_commit_output_encoding();
@@ -1785,7 +1786,7 @@ static int do_interactive(struct am_state *state)
}
strbuf_release(&msg);
} else if (*reply == 'v' || *reply == 'V') {
- const char *pager = git_pager(1);
+ const char *pager = git_pager(the_repository, 1);
struct child_process cp = CHILD_PROCESS_INIT;
if (!pager)
@@ -2245,7 +2246,7 @@ static int show_patch(struct am_state *state, enum resume_type resume_mode)
if (len < 0)
die_errno(_("failed to read '%s'"), patch_path);
- setup_pager();
+ setup_pager(the_repository);
write_in_full(1, sb.buf, sb.len);
strbuf_release(&sb);
return 0;
@@ -2426,8 +2427,7 @@ int cmd_am(int argc,
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(usage, options);
+ show_usage_with_options_if_asked(argc, argv, usage, options);
git_config(git_default_config, NULL);
diff --git a/builtin/bisect.c b/builtin/bisect.c
index 8166d4abf5..8b8d870cd1 100644
--- a/builtin/bisect.c
+++ b/builtin/bisect.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "copy.h"
#include "environment.h"
diff --git a/builtin/blame.c b/builtin/blame.c
index 6a7bb3b072..c470654c7e 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -4,7 +4,9 @@
* Copyright (c) 2006, 2014 by its authors
* See COPYING for licensing conditions
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "color.h"
@@ -465,9 +467,14 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
reset = GIT_COLOR_RESET;
}
+ if (abbrev < MINIMUM_ABBREV)
+ BUG("abbreviation is smaller than minimum length: %d < %d",
+ abbrev, MINIMUM_ABBREV);
+
for (cnt = 0; cnt < ent->num_lines; cnt++) {
char ch;
- int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? the_hash_algo->hexsz : abbrev;
+ size_t length = (opt & OUTPUT_LONG_OBJECT_NAME) ?
+ the_hash_algo->hexsz : (size_t) abbrev;
if (opt & OUTPUT_COLOR_LINE) {
if (cnt > 0) {
@@ -482,9 +489,9 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
fputs(color, stdout);
if (suspect->commit->object.flags & UNINTERESTING) {
- if (blank_boundary)
- memset(hex, ' ', length);
- else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
+ if (blank_boundary) {
+ memset(hex, ' ', strlen(hex));
+ } else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
length--;
putchar('^');
}
@@ -498,7 +505,8 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
length--;
putchar('?');
}
- printf("%.*s", length, hex);
+
+ printf("%.*s", (int)(length < GIT_MAX_HEXSZ ? length : GIT_MAX_HEXSZ), hex);
if (opt & OUTPUT_ANNOTATE_COMPAT) {
const char *name;
if (opt & OUTPUT_SHOW_EMAIL)
@@ -1186,14 +1194,16 @@ parse_done:
sb.found_guilty_entry = &found_guilty_entry;
sb.found_guilty_entry_data = &pi;
if (show_progress)
- pi.progress = start_delayed_progress(_("Blaming lines"), num_lines);
+ pi.progress = start_delayed_progress(the_repository,
+ _("Blaming lines"),
+ num_lines);
assign_blame(&sb, opt);
stop_progress(&pi.progress);
if (!incremental)
- setup_pager();
+ setup_pager(the_repository);
else
goto cleanup;
diff --git a/builtin/branch.c b/builtin/branch.c
index 05ba4cd7a6..c150131bd9 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -4,7 +4,9 @@
* Copyright (c) 2006 Kristian Høgsberg <krh@redhat.com>
* Based on git-branch.sh by Junio C Hamano.
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "color.h"
@@ -257,7 +259,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
char *target = NULL;
int flags = 0;
- strbuf_branchname(&bname, argv[i], allowed_interpret);
+ copy_branchname(&bname, argv[i], allowed_interpret);
free(name);
name = mkpathdup(fmt, bname.buf);
@@ -471,7 +473,7 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
if (verify_ref_format(format))
die(_("unable to parse format string"));
- filter_ahead_behind(the_repository, format, &array);
+ filter_ahead_behind(the_repository, &array);
ref_array_sort(sorting, &array);
if (column_active(colopts)) {
@@ -579,7 +581,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
int recovery = 0, oldref_usage = 0;
struct worktree **worktrees = get_worktrees();
- if (strbuf_check_branch_ref(&oldref, oldname)) {
+ if (check_branch_ref(&oldref, oldname)) {
/*
* Bad name --- this could be an attempt to rename a
* ref that we used to allow to be created by accident.
@@ -782,8 +784,8 @@ int cmd_branch(int argc,
filter.kind = FILTER_REFS_BRANCHES;
filter.abbrev = -1;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_branch_usage, options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_branch_usage, options);
/*
* Try to set sort keys from config. If config does not set any,
@@ -882,7 +884,6 @@ int cmd_branch(int argc,
string_list_clear(&output, 0);
ref_sorting_release(sorting);
ref_filter_clear(&filter);
- ref_format_clear(&format);
ret = 0;
goto out;
@@ -896,7 +897,7 @@ int cmd_branch(int argc,
die(_("cannot give description to detached HEAD"));
branch_name = head;
} else if (argc == 1) {
- strbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
+ copy_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
branch_name = buf.buf;
} else {
die(_("cannot edit description of more than one branch"));
@@ -939,7 +940,7 @@ int cmd_branch(int argc,
if (!argc)
branch = branch_get(NULL);
else if (argc == 1) {
- strbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
+ copy_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
branch = branch_get(buf.buf);
} else
die(_("too many arguments to set new upstream"));
@@ -969,7 +970,7 @@ int cmd_branch(int argc,
if (!argc)
branch = branch_get(NULL);
else if (argc == 1) {
- strbuf_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
+ copy_branchname(&buf, argv[0], INTERPRET_BRANCH_LOCAL);
branch = branch_get(buf.buf);
} else
die(_("too many arguments to unset upstream"));
diff --git a/builtin/bugreport.c b/builtin/bugreport.c
index 7c2df035c9..0ac59cc8dc 100644
--- a/builtin/bugreport.c
+++ b/builtin/bugreport.c
@@ -167,7 +167,7 @@ int cmd_bugreport(int argc,
strbuf_addftime(&zip_path, option_suffix, localtime_r(&now, &tm), 0, 0);
strbuf_addstr(&zip_path, ".zip");
- if (create_diagnostics_archive(&zip_path, diagnose))
+ if (create_diagnostics_archive(the_repository, &zip_path, diagnose))
die_errno(_("unable to create diagnostics archive %s"), zip_path.buf);
strbuf_release(&zip_path);
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 3f14754197..1e170e9278 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -222,7 +222,7 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix,
strvec_pushl(&extra_index_pack_args, "-v", "--progress-title",
_("Unbundling objects"), NULL);
ret = !!unbundle(the_repository, &header, bundle_fd,
- &extra_index_pack_args, 0) ||
+ &extra_index_pack_args, NULL) ||
list_bundle_refs(&header, argc, argv);
bundle_header_release(&header);
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index bfdfb51c7c..b13561cf73 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -3,7 +3,10 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "convert.h"
@@ -827,15 +830,16 @@ static int batch_objects(struct batch_options *opt)
cb.seen = &seen;
for_each_loose_object(batch_unordered_loose, &cb, 0);
- for_each_packed_object(batch_unordered_packed, &cb,
- FOR_EACH_OBJECT_PACK_ORDER);
+ for_each_packed_object(the_repository, batch_unordered_packed,
+ &cb, FOR_EACH_OBJECT_PACK_ORDER);
oidset_clear(&seen);
} else {
struct oid_array sa = OID_ARRAY_INIT;
for_each_loose_object(collect_loose_object, &sa, 0);
- for_each_packed_object(collect_packed_object, &sa, 0);
+ for_each_packed_object(the_repository, collect_packed_object,
+ &sa, 0);
oid_array_for_each_unique(&sa, batch_object_cb, &cb);
diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c
index e86d8ef980..5d80afeec0 100644
--- a/builtin/check-ref-format.c
+++ b/builtin/check-ref-format.c
@@ -42,7 +42,7 @@ static int check_ref_format_branch(const char *arg)
int nongit;
setup_git_directory_gently(&nongit);
- if (strbuf_check_branch_ref(&sb, arg) ||
+ if (check_branch_ref(&sb, arg) ||
!skip_prefix(sb.buf, "refs/heads/", &name))
die("'%s' is not a valid branch name", arg);
printf("%s\n", name);
@@ -64,8 +64,8 @@ int cmd_check_ref_format(int argc,
BUG_ON_NON_EMPTY_PREFIX(prefix);
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(builtin_check_ref_format_usage);
+ show_usage_if_asked(argc, argv,
+ builtin_check_ref_format_usage);
if (argc == 3 && !strcmp(argv[1], "--branch"))
return check_ref_format_branch(argv[2]);
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index ff6cdccc21..da9345a44b 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "entry.h"
@@ -126,9 +128,9 @@ int cmd_checkout__worker(int argc,
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(checkout_worker_usage,
- checkout_worker_options);
+ show_usage_with_options_if_asked(argc, argv,
+ checkout_worker_usage,
+ checkout_worker_options);
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, checkout_worker_options,
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index 6dd38eb05d..e30086c7d4 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -4,7 +4,10 @@
* Copyright (C) 2005 Linus Torvalds
*
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
@@ -247,9 +250,9 @@ int cmd_checkout_index(int argc,
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_checkout_index_usage,
- builtin_checkout_index_options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_checkout_index_usage,
+ builtin_checkout_index_options);
git_config(git_default_config, NULL);
prefix_length = prefix ? strlen(prefix) : 0;
diff --git a/builtin/checkout.c b/builtin/checkout.c
index c449558e66..01ea9ff8b2 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "advice.h"
#include "branch.h"
@@ -742,7 +744,7 @@ static void setup_branch_path(struct branch_info *branch)
&branch->oid, &branch->refname, 0))
repo_get_oid_committish(the_repository, branch->name, &branch->oid);
- strbuf_branchname(&buf, branch->name, INTERPRET_BRANCH_LOCAL);
+ copy_branchname(&buf, branch->name, INTERPRET_BRANCH_LOCAL);
if (strcmp(buf.buf, branch->name)) {
free(branch->name);
branch->name = xstrdup(buf.buf);
diff --git a/builtin/clean.c b/builtin/clean.c
index 9c48dd0271..053c94fc6b 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -5,7 +5,10 @@
*
* Based on git-clean.sh by Pavel Roskin
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "config.h"
diff --git a/builtin/clone.c b/builtin/clone.c
index 21721db28a..fd001d800c 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -7,7 +7,10 @@
*
* Clone a repository into a different directory that does not yet exist.
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index bd70d052e7..8ca75262c5 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -305,6 +305,7 @@ static int graph_write(int argc, const char **argv, const char *prefix,
oidset_init(&commits, 0);
if (opts.progress)
progress = start_delayed_progress(
+ the_repository,
_("Collecting commits from input"), 0);
while (strbuf_getline(&buf, stdin) != EOF) {
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 2ca1a57ebb..38457600a4 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -119,8 +119,8 @@ int cmd_commit_tree(int argc,
git_config(git_default_config, NULL);
- if (argc < 2 || !strcmp(argv[1], "-h"))
- usage_with_options(commit_tree_usage, options);
+ show_usage_with_options_if_asked(argc, argv,
+ commit_tree_usage, options);
argc = parse_options(argc, argv, prefix, options, commit_tree_usage, 0);
diff --git a/builtin/commit.c b/builtin/commit.c
index 71d674138c..9fb405dd4a 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -4,7 +4,10 @@
* Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -41,7 +44,7 @@
#include "trailer.h"
static const char * const builtin_commit_usage[] = {
- N_("git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+ N_("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"
@@ -1556,8 +1559,8 @@ struct repository *repo UNUSED)
OPT_END(),
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_status_usage, builtin_status_options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_status_usage, builtin_status_options);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
@@ -1733,8 +1736,8 @@ int cmd_commit(int argc,
struct strbuf err = STRBUF_INIT;
int ret = 0;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_commit_usage, builtin_commit_options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_commit_usage, builtin_commit_options);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index 04d80887e0..1e89148ed7 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -67,7 +67,7 @@ static int count_loose(const struct object_id *oid, const char *path,
else {
loose_size += on_disk_bytes(st);
loose++;
- if (verbose && has_object_pack(oid))
+ if (verbose && has_object_pack(the_repository, oid))
packed_loose++;
}
return 0;
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index bc22f5c6d2..e707618e74 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -142,9 +142,9 @@ static void serve_one_client(FILE *in, FILE *out)
fprintf(out, "username=%s\n", e->item.username);
if (e->item.password)
fprintf(out, "password=%s\n", e->item.password);
- if (credential_has_capability(&c.capa_authtype, CREDENTIAL_OP_HELPER) && e->item.authtype)
+ if (credential_has_capability(&c.capa_authtype, CREDENTIAL_OP_RESPONSE) && e->item.authtype)
fprintf(out, "authtype=%s\n", e->item.authtype);
- if (credential_has_capability(&c.capa_authtype, CREDENTIAL_OP_HELPER) && e->item.credential)
+ if (credential_has_capability(&c.capa_authtype, CREDENTIAL_OP_RESPONSE) && e->item.credential)
fprintf(out, "credential=%s\n", e->item.credential);
if (e->item.password_expiry_utc != TIME_MAX)
fprintf(out, "password_expiry_utc=%"PRItime"\n",
diff --git a/builtin/credential.c b/builtin/credential.c
index 14c8c6608b..2e11b15dde 100644
--- a/builtin/credential.c
+++ b/builtin/credential.c
@@ -18,7 +18,8 @@ int cmd_credential(int argc,
git_config(git_default_config, NULL);
- if (argc != 2 || !strcmp(argv[1], "-h"))
+ show_usage_if_asked(argc, argv, usage_msg);
+ if (argc != 2)
usage(usage_msg);
op = argv[1];
@@ -32,15 +33,15 @@ int cmd_credential(int argc,
die("unable to read credential from stdin");
if (!strcmp(op, "fill")) {
- credential_fill(&c, 0);
+ credential_fill(the_repository, &c, 0);
credential_next_state(&c);
credential_write(&c, stdout, CREDENTIAL_OP_RESPONSE);
} else if (!strcmp(op, "approve")) {
credential_set_all_capabilities(&c, CREDENTIAL_OP_HELPER);
- credential_approve(&c);
+ credential_approve(the_repository, &c);
} else if (!strcmp(op, "reject")) {
credential_set_all_capabilities(&c, CREDENTIAL_OP_HELPER);
- credential_reject(&c);
+ credential_reject(the_repository, &c);
} else {
usage(usage_msg);
}
diff --git a/builtin/describe.c b/builtin/describe.c
index 7330a77b38..e2e73f3d75 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "environment.h"
@@ -366,6 +368,13 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
struct commit_name **slot;
seen_commits++;
+
+ if (match_cnt == max_candidates ||
+ match_cnt == hashmap_get_size(&names)) {
+ gave_up_on = c;
+ break;
+ }
+
slot = commit_names_peek(&commit_names, c);
n = slot ? *slot : NULL;
if (n) {
@@ -381,10 +390,6 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
if (n->prio == 2)
annotated_cnt++;
}
- else {
- gave_up_on = c;
- break;
- }
}
for (cur_match = 0; cur_match < match_cnt; cur_match++) {
struct possible_tag *t = &all_matches[cur_match];
@@ -470,9 +475,8 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
fprintf(stderr, _("traversed %lu commits\n"), seen_commits);
if (gave_up_on) {
fprintf(stderr,
- _("more than %i tags found; listed %i most recent\n"
- "gave up search at %s\n"),
- max_candidates, max_candidates,
+ _("found %i tags; gave up search at %s\n"),
+ max_candidates,
oid_to_hex(&gave_up_on->object.oid));
}
}
diff --git a/builtin/diagnose.c b/builtin/diagnose.c
index 66a22d918e..33c39bd598 100644
--- a/builtin/diagnose.c
+++ b/builtin/diagnose.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
@@ -58,7 +60,7 @@ int cmd_diagnose(int argc,
}
/* Prepare diagnostics */
- if (create_diagnostics_archive(&zip_path, mode))
+ if (create_diagnostics_archive(the_repository, &zip_path, mode))
die_errno(_("unable to create diagnostics archive %s"),
zip_path.buf);
diff --git a/builtin/diff-files.c b/builtin/diff-files.c
index e0e0ccec23..99b1749723 100644
--- a/builtin/diff-files.c
+++ b/builtin/diff-files.c
@@ -3,7 +3,10 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "diff.h"
@@ -26,8 +29,7 @@ int cmd_diff_files(int argc,
int result;
unsigned options = 0;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(diff_files_usage);
+ show_usage_if_asked(argc, argv, diff_files_usage);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index ad503624c0..81c0bc8ed7 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "diff.h"
@@ -24,8 +26,7 @@ int cmd_diff_index(int argc,
int i;
int result;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(diff_cache_usage);
+ show_usage_if_asked(argc, argv, diff_cache_usage);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 4b6656bb9f..e31cc797fe 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "diff.h"
@@ -121,8 +122,7 @@ int cmd_diff_tree(int argc,
int read_stdin = 0;
int merge_base = 0;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(diff_tree_usage);
+ show_usage_if_asked(argc, argv, diff_tree_usage);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
diff --git a/builtin/diff.c b/builtin/diff.c
index 2fe92f373e..a4fffee42c 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -3,7 +3,10 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "ewah/ewok.h"
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 40e971e225..03a8bb92a9 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -11,7 +11,9 @@
*
* Copyright (C) 2016 Johannes Schindelin
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
@@ -364,7 +366,8 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
char *lbase_dir = NULL, *rbase_dir = NULL;
size_t ldir_len, rdir_len, wtdir_len;
const char *workdir, *tmp;
- int ret = 0, i;
+ int ret = 0;
+ size_t i;
FILE *fp = NULL;
struct hashmap working_tree_dups = HASHMAP_INIT(working_tree_entry_cmp,
NULL);
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index e17f262e8e..a5c82eef1d 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -3,7 +3,10 @@
*
* Copyright (C) 2007 Johannes E. Schindelin
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 457cdb40cc..2da46fecdc 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "environment.h"
@@ -13,6 +15,7 @@
#include "delta.h"
#include "pack.h"
#include "path.h"
+#include "read-cache-ll.h"
#include "refs.h"
#include "csum-file.h"
#include "quote.h"
@@ -766,6 +769,7 @@ static void start_packfile(void)
p->pack_fd = pack_fd;
p->do_not_close = 1;
+ p->repo = the_repository;
pack_file = hashfd(pack_fd, p->pack_name);
pack_data = p;
@@ -806,7 +810,7 @@ static char *keep_pack(const char *curr_index_name)
struct strbuf name = STRBUF_INIT;
int keep_fd;
- odb_pack_name(&name, pack_data->hash, "keep");
+ odb_pack_name(pack_data->repo, &name, pack_data->hash, "keep");
keep_fd = odb_pack_keep(name.buf);
if (keep_fd < 0)
die_errno("cannot create keep file");
@@ -814,11 +818,11 @@ static char *keep_pack(const char *curr_index_name)
if (close(keep_fd))
die_errno("failed to write keep file");
- odb_pack_name(&name, pack_data->hash, "pack");
+ odb_pack_name(pack_data->repo, &name, pack_data->hash, "pack");
if (finalize_object_file(pack_data->pack_name, name.buf))
die("cannot store pack file");
- odb_pack_name(&name, pack_data->hash, "idx");
+ odb_pack_name(pack_data->repo, &name, pack_data->hash, "idx");
if (finalize_object_file(curr_index_name, name.buf))
die("cannot store index file");
free((void *)curr_index_name);
@@ -832,7 +836,7 @@ static void unkeep_all_packs(void)
for (k = 0; k < pack_id; k++) {
struct packed_git *p = all_packs[k];
- odb_pack_name(&name, p->hash, "keep");
+ odb_pack_name(p->repo, &name, p->hash, "keep");
unlink_or_warn(name.buf);
}
strbuf_release(&name);
@@ -889,7 +893,7 @@ static void end_packfile(void)
idx_name = keep_pack(create_index());
/* Register the packfile with core git's machinery. */
- new_p = add_packed_git(idx_name, strlen(idx_name), 1);
+ new_p = add_packed_git(pack_data->repo, idx_name, strlen(idx_name), 1);
if (!new_p)
die("core git rejected index %s", idx_name);
all_packs[pack_id] = new_p;
@@ -1102,7 +1106,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
|| (pack_size + PACK_SIZE_THRESHOLD + len) < pack_size)
cycle_packfile();
- the_hash_algo->init_fn(&checkpoint.ctx);
+ the_hash_algo->unsafe_init_fn(&checkpoint.ctx);
hashfile_checkpoint(pack_file, &checkpoint);
offset = checkpoint.offset;
@@ -2425,6 +2429,9 @@ static void file_change_m(const char *p, struct branch *b)
tree_content_replace(&b->branch_tree, &oid, mode, NULL);
return;
}
+
+ if (!verify_path(path.buf, mode))
+ die("invalid path '%s'", path.buf);
tree_content_set(&b->branch_tree, path.buf, &oid, mode, NULL);
}
@@ -2462,6 +2469,8 @@ static void file_change_cr(const char *p, struct branch *b, int rename)
leaf.tree);
return;
}
+ if (!verify_path(dest.buf, leaf.versions[1].mode))
+ die("invalid path '%s'", dest.buf);
tree_content_set(&b->branch_tree, dest.buf,
&leaf.versions[1].oid,
leaf.versions[1].mode,
@@ -3552,12 +3561,11 @@ static void parse_argv(void)
int cmd_fast_import(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
unsigned int i;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(fast_import_usage);
+ show_usage_if_asked(argc, argv, fast_import_usage);
reset_pack_idx_option(&pack_idx_opts);
git_pack_config();
@@ -3673,7 +3681,7 @@ int cmd_fast_import(int argc,
fprintf(stderr, " pools: %10lu KiB\n", (unsigned long)((tree_entry_allocd + fi_mem_pool.pool_alloc) /1024));
fprintf(stderr, " objects: %10" PRIuMAX " KiB\n", (alloc_count*sizeof(struct object_entry))/1024);
fprintf(stderr, "---------------------------------------------------------------------\n");
- pack_report();
+ pack_report(repo);
fprintf(stderr, "---------------------------------------------------------------------\n");
fprintf(stderr, "\n");
}
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 62e8c3aa6b..d07eec9e55 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
@@ -73,6 +75,8 @@ int cmd_fetch_pack(int argc,
list_objects_filter_init(&args.filter_options);
args.uploadpack = "git-upload-pack";
+ show_usage_if_asked(argc, argv, fetch_pack_usage);
+
for (i = 1; i < argc && *argv[i] == '-'; i++) {
const char *arg = argv[i];
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 335083eb10..fe2b26c74a 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1,7 +1,10 @@
/*
* "git fetch"
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -1574,6 +1577,135 @@ static int backfill_tags(struct display_state *display_state,
return retcode;
}
+static const char *strip_refshead(const char *name){
+ skip_prefix(name, "refs/heads/", &name);
+ return name;
+}
+
+static void set_head_advice_msg(const char *remote, const char *head_name)
+{
+ const char message_advice_set_head[] =
+ N_("Run 'git remote set-head %s %s' to follow the change, or set\n"
+ "'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+ "if you do not want to see this message. Specifically running\n"
+ "'git config set remote.%s.followRemoteHEAD warn-if-not-branch-%s'\n"
+ "will disable the warning until the remote changes HEAD to something else.");
+
+ advise_if_enabled(ADVICE_FETCH_SET_HEAD_WARN, _(message_advice_set_head),
+ remote, head_name, remote, remote, head_name);
+}
+
+static void report_set_head(const char *remote, const char *head_name,
+ struct strbuf *buf_prev, int updateres) {
+ struct strbuf buf_prefix = STRBUF_INIT;
+ const char *prev_head = NULL;
+
+ strbuf_addf(&buf_prefix, "refs/remotes/%s/", remote);
+ skip_prefix(buf_prev->buf, buf_prefix.buf, &prev_head);
+
+ if (prev_head && strcmp(prev_head, head_name)) {
+ printf("'HEAD' at '%s' is '%s', but we have '%s' locally.\n",
+ remote, head_name, prev_head);
+ set_head_advice_msg(remote, head_name);
+ }
+ else if (updateres && buf_prev->len) {
+ printf("'HEAD' at '%s' is '%s', "
+ "but we have a detached HEAD pointing to '%s' locally.\n",
+ remote, head_name, buf_prev->buf);
+ set_head_advice_msg(remote, head_name);
+ }
+ strbuf_release(&buf_prefix);
+}
+
+static int set_head(const struct ref *remote_refs, int follow_remote_head,
+ const char *no_warn_branch)
+{
+ int result = 0, create_only, is_bare, was_detached;
+ struct strbuf b_head = STRBUF_INIT, b_remote_head = STRBUF_INIT,
+ b_local_head = STRBUF_INIT;
+ const char *remote = gtransport->remote->name;
+ char *head_name = NULL;
+ struct ref *ref, *matches;
+ struct ref *fetch_map = NULL, **fetch_map_tail = &fetch_map;
+ struct refspec_item refspec = {
+ .force = 0,
+ .pattern = 1,
+ .src = (char *) "refs/heads/*",
+ .dst = (char *) "refs/heads/*",
+ };
+ struct string_list heads = STRING_LIST_INIT_DUP;
+ struct ref_store *refs = get_main_ref_store(the_repository);
+
+ get_fetch_map(remote_refs, &refspec, &fetch_map_tail, 0);
+ matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
+ fetch_map, 1);
+ for (ref = matches; ref; ref = ref->next) {
+ string_list_append(&heads, strip_refshead(ref->name));
+ }
+
+ if (follow_remote_head == FOLLOW_REMOTE_NEVER)
+ goto cleanup;
+
+ if (!heads.nr)
+ result = 1;
+ else if (heads.nr > 1)
+ result = 1;
+ else
+ head_name = xstrdup(heads.items[0].string);
+
+ if (!head_name)
+ goto cleanup;
+ is_bare = is_bare_repository();
+ create_only = follow_remote_head == FOLLOW_REMOTE_ALWAYS ? 0 : !is_bare;
+ if (is_bare) {
+ strbuf_addstr(&b_head, "HEAD");
+ strbuf_addf(&b_remote_head, "refs/heads/%s", head_name);
+ } else {
+ strbuf_addf(&b_head, "refs/remotes/%s/HEAD", remote);
+ strbuf_addf(&b_remote_head, "refs/remotes/%s/%s", remote, head_name);
+ }
+ /* make sure it's valid */
+ if (!is_bare && !refs_ref_exists(refs, b_remote_head.buf)) {
+ result = 1;
+ goto cleanup;
+ }
+ was_detached = refs_update_symref_extended(refs, b_head.buf, b_remote_head.buf,
+ "fetch", &b_local_head, create_only);
+ if (was_detached == -1) {
+ result = 1;
+ goto cleanup;
+ }
+ if (verbosity >= 0 &&
+ follow_remote_head == FOLLOW_REMOTE_WARN &&
+ (!no_warn_branch || strcmp(no_warn_branch, head_name)))
+ report_set_head(remote, head_name, &b_local_head, was_detached);
+
+cleanup:
+ free(head_name);
+ free_refs(fetch_map);
+ free_refs(matches);
+ string_list_clear(&heads, 0);
+ strbuf_release(&b_head);
+ strbuf_release(&b_local_head);
+ strbuf_release(&b_remote_head);
+ return result;
+}
+
+static int uses_remote_tracking(struct transport *transport, struct refspec *rs)
+{
+ if (!remote_is_configured(transport->remote, 0))
+ return 0;
+
+ if (!rs->nr)
+ rs = &transport->remote->fetch;
+
+ for (int i = 0; i < rs->nr; i++)
+ if (rs->items[i].dst)
+ return 1;
+
+ return 0;
+}
+
static int do_fetch(struct transport *transport,
struct refspec *rs,
const struct fetch_config *config)
@@ -1643,6 +1775,11 @@ static int do_fetch(struct transport *transport,
"refs/tags/");
}
+ if (uses_remote_tracking(transport, rs)) {
+ must_list_refs = 1;
+ strvec_push(&transport_ls_refs_options.ref_prefixes, "HEAD");
+ }
+
if (must_list_refs) {
trace2_region_enter("fetch", "remote_refs", the_repository);
remote_refs = transport_get_remote_refs(transport,
@@ -1787,6 +1924,13 @@ static int do_fetch(struct transport *transport,
"you need to specify exactly one branch with the --set-upstream option"));
}
}
+ if (set_head(remote_refs, transport->remote->follow_remote_head,
+ transport->remote->no_warn_branch))
+ ;
+ /*
+ * Way too many cases where this can go wrong
+ * so let's just fail silently for now.
+ */
cleanup:
if (retcode) {
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 715745a262..8085ebd8fe 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -108,7 +108,6 @@ int cmd_for_each_ref(int argc,
filter_and_format_refs(&filter, flags, sorting, &format);
ref_filter_clear(&filter);
- ref_format_clear(&format);
ref_sorting_release(sorting);
strvec_clear(&vec);
return 0;
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index fae7f91cf1..325a7925f1 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
@@ -36,7 +37,7 @@ int cmd_for_each_repo(int argc,
{
static const char *config_key = NULL;
int keep_going = 0;
- int i, result = 0;
+ int result = 0;
const struct string_list *values;
int err;
@@ -61,7 +62,7 @@ int cmd_for_each_repo(int argc,
else if (err)
return 0;
- for (i = 0; i < values->nr; i++) {
+ for (size_t i = 0; i < values->nr; i++) {
int ret = run_command_on_repo(values->items[i].string, argc, argv);
if (ret) {
if (!keep_going)
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 7f4e2f0414..7a4dcb0716 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -150,7 +150,7 @@ static int mark_object(struct object *obj, enum object_type type,
return 0;
obj->flags |= REACHABLE;
- if (is_promisor_object(&obj->oid))
+ if (is_promisor_object(the_repository, &obj->oid))
/*
* Further recursion does not need to be performed on this
* object since it is a promisor object (so it does not need to
@@ -197,7 +197,8 @@ static int traverse_reachable(void)
unsigned int nr = 0;
int result = 0;
if (show_progress)
- progress = start_delayed_progress(_("Checking connectivity"), 0);
+ progress = start_delayed_progress(the_repository,
+ _("Checking connectivity"), 0);
while (pending.nr) {
result |= traverse_one_object(object_array_pop(&pending));
display_progress(progress, ++nr);
@@ -270,9 +271,9 @@ static void check_reachable_object(struct object *obj)
* do a full fsck
*/
if (!(obj->flags & HAS_OBJ)) {
- if (is_promisor_object(&obj->oid))
+ if (is_promisor_object(the_repository, &obj->oid))
return;
- if (has_object_pack(&obj->oid))
+ if (has_object_pack(the_repository, &obj->oid))
return; /* it is in pack - forget about it */
printf_ln(_("missing %s %s"),
printable_type(&obj->oid, obj->type),
@@ -391,7 +392,10 @@ static void check_connectivity(void)
* traversal.
*/
for_each_loose_object(mark_loose_unreachable_referents, NULL, 0);
- for_each_packed_object(mark_packed_unreachable_referents, NULL, 0);
+ for_each_packed_object(the_repository,
+ mark_packed_unreachable_referents,
+ NULL,
+ 0);
}
/* Look up all the requirements, warn about missing objects.. */
@@ -488,7 +492,7 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,
refname, timestamp);
obj->flags |= USED;
mark_object_reachable(obj);
- } else if (!is_promisor_object(oid)) {
+ } else if (!is_promisor_object(the_repository, oid)) {
error(_("%s: invalid reflog entry %s"),
refname, oid_to_hex(oid));
errors_found |= ERROR_REACHABLE;
@@ -531,7 +535,7 @@ static int fsck_handle_ref(const char *refname, const char *referent UNUSED, con
obj = parse_object(the_repository, oid);
if (!obj) {
- if (is_promisor_object(oid)) {
+ if (is_promisor_object(the_repository, oid)) {
/*
* Increment default_refs anyway, because this is a
* valid ref.
@@ -700,7 +704,8 @@ static void fsck_object_dir(const char *path)
fprintf_ln(stderr, _("Checking object directory"));
if (show_progress)
- progress = start_progress(_("Checking object directories"), 256);
+ progress = start_progress(the_repository,
+ _("Checking object directories"), 256);
for_each_loose_file_in_objdir(path, fsck_loose, fsck_cruft, fsck_subdir,
&cb_data);
@@ -876,7 +881,8 @@ static int check_pack_rev_indexes(struct repository *r, int show_progress)
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);
+ progress = start_delayed_progress(the_repository,
+ "Verifying reverse pack-indexes", pack_count);
pack_count = 0;
}
@@ -966,7 +972,8 @@ int cmd_fsck(int argc,
if (connectivity_only) {
for_each_loose_object(mark_loose_for_connectivity, NULL, 0);
- for_each_packed_object(mark_packed_for_connectivity, NULL, 0);
+ for_each_packed_object(the_repository,
+ mark_packed_for_connectivity, NULL, 0);
} else {
prepare_alt_odb(the_repository);
for (odb = the_repository->objects->odb; odb; odb = odb->next)
@@ -985,7 +992,8 @@ int cmd_fsck(int argc,
total += p->num_objects;
}
- progress = start_progress(_("Checking objects"), total);
+ progress = start_progress(the_repository,
+ _("Checking objects"), total);
}
for (p = get_all_packs(the_repository); p;
p = p->next) {
@@ -1011,7 +1019,7 @@ int cmd_fsck(int argc,
&oid);
if (!obj || !(obj->flags & HAS_OBJ)) {
- if (is_promisor_object(&oid))
+ if (is_promisor_object(the_repository, &oid))
continue;
error(_("%s: object missing"), oid_to_hex(&oid));
errors_found |= ERROR_OBJECT;
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index f3f6bd330b..0820e524f1 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -1596,8 +1598,8 @@ int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix UNUSED
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_fsmonitor__daemon_usage, options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_fsmonitor__daemon_usage, options);
die(_("fsmonitor--daemon not supported on this platform"));
}
diff --git a/builtin/gc.c b/builtin/gc.c
index 364cb0eacf..0bf3533494 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -9,7 +9,10 @@
*
* Copyright (c) 2006 Shawn O. Pearce
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "date.h"
@@ -138,6 +141,11 @@ struct gc_config {
char *repack_filter_to;
unsigned long big_pack_threshold;
unsigned long max_delta_cache_size;
+ /*
+ * Remove this member from gc_config once repo_settings is passed
+ * through the callchain.
+ */
+ size_t delta_base_cache_limit;
};
#define GC_CONFIG_INIT { \
@@ -153,6 +161,7 @@ struct gc_config {
.prune_expire = xstrdup("2.weeks.ago"), \
.prune_worktrees_expire = xstrdup("3.months.ago"), \
.max_delta_cache_size = DEFAULT_DELTA_CACHE_SIZE, \
+ .delta_base_cache_limit = DEFAULT_DELTA_BASE_CACHE_LIMIT, \
}
static void gc_config_release(struct gc_config *cfg)
@@ -168,6 +177,7 @@ static void gc_config(struct gc_config *cfg)
{
const char *value;
char *owned = NULL;
+ unsigned long ulongval;
if (!git_config_get_value("gc.packrefs", &value)) {
if (value && !strcmp(value, "notbare"))
@@ -206,6 +216,9 @@ static void gc_config(struct gc_config *cfg)
git_config_get_ulong("gc.bigpackthreshold", &cfg->big_pack_threshold);
git_config_get_ulong("pack.deltacachesize", &cfg->max_delta_cache_size);
+ if (!git_config_get_ulong("core.deltabasecachelimit", &ulongval))
+ cfg->delta_base_cache_limit = ulongval;
+
if (!git_config_get_string("gc.repackfilter", &owned)) {
free(cfg->repack_filter);
cfg->repack_filter = owned;
@@ -416,7 +429,7 @@ static uint64_t estimate_repack_memory(struct gc_config *cfg,
* read_sha1_file() (either at delta calculation phase, or
* writing phase) also fills up the delta base cache
*/
- heap += delta_base_cache_limit;
+ heap += cfg->delta_base_cache_limit;
/* and of course pack-objects has its own delta cache */
heap += cfg->max_delta_cache_size;
@@ -697,8 +710,8 @@ struct repository *repo UNUSED)
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_gc_usage, builtin_gc_options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_gc_usage, builtin_gc_options);
strvec_pushl(&reflog, "reflog", "expire", "--all", NULL);
strvec_pushl(&repack, "repack", "-d", "-l", NULL);
@@ -1896,7 +1909,7 @@ static int get_random_minute(void)
if (getenv("GIT_TEST_MAINT_SCHEDULER"))
return 13;
- return git_rand() % 60;
+ return git_rand(0) % 60;
}
static int is_launchctl_available(void)
diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c
index 6bec0d1854..e4cd1627b4 100644
--- a/builtin/get-tar-commit-id.c
+++ b/builtin/get-tar-commit-id.c
@@ -13,7 +13,7 @@ static const char builtin_get_tar_commit_id_usage[] =
#define HEADERSIZE (2 * RECORDSIZE)
int cmd_get_tar_commit_id(int argc,
- const char **argv UNUSED,
+ const char **argv,
const char *prefix,
struct repository *repo UNUSED)
{
@@ -27,6 +27,8 @@ int cmd_get_tar_commit_id(int argc,
BUG_ON_NON_EMPTY_PREFIX(prefix);
+ show_usage_if_asked(argc, argv, builtin_get_tar_commit_id_usage);
+
if (argc != 1)
usage(builtin_get_tar_commit_id_usage);
diff --git a/builtin/grep.c b/builtin/grep.c
index 98b85c7fca..d1427290f7 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -3,7 +3,10 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
@@ -1081,7 +1084,7 @@ int cmd_grep(int argc,
}
if (show_in_pager == default_pager)
- show_in_pager = git_pager(1);
+ show_in_pager = git_pager(the_repository, 1);
if (show_in_pager) {
opt.color = 0;
opt.name_only = 1;
@@ -1243,7 +1246,7 @@ int cmd_grep(int argc,
}
if (!show_in_pager && !opt.status_only)
- setup_pager();
+ setup_pager(the_repository);
die_for_incompatible_opt3(!use_index, "--no-index",
untracked, "--untracked",
diff --git a/builtin/help.c b/builtin/help.c
index 6a72d991a8..c257079ceb 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -1,8 +1,9 @@
-
/*
* Builtin help command
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "exec-cmd.h"
@@ -129,7 +130,6 @@ static void list_config_help(enum show_config_type type)
struct string_list keys = STRING_LIST_INIT_DUP;
struct string_list keys_uniq = STRING_LIST_INIT_DUP;
struct string_list_item *item;
- int i;
for (p = config_name_list; *p; p++) {
const char *var = *p;
@@ -156,7 +156,7 @@ static void list_config_help(enum show_config_type type)
e->prefix, e->placeholder);
string_list_sort(&keys);
- for (i = 0; i < keys.nr; i++) {
+ for (size_t i = 0; i < keys.nr; i++) {
const char *var = keys.items[i].string;
const char *wildcard, *tag, *cut;
const char *dot = NULL;
@@ -658,7 +658,7 @@ int cmd_help(int argc,
case HELP_ACTION_ALL:
opt_mode_usage(argc, "--all", help_format);
if (verbose) {
- setup_pager();
+ setup_pager(the_repository);
list_all_cmds_help(show_external_commands,
show_aliases);
return 0;
@@ -692,7 +692,7 @@ int cmd_help(int argc,
return 0;
case HELP_ACTION_CONFIG:
opt_mode_usage(argc, "--config", help_format);
- setup_pager();
+ setup_pager(the_repository);
list_config_help(SHOW_CONFIG_HUMAN);
printf("\n%s\n", _("'git help config' for more information"));
return 0;
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 95babdc5ea..6ffbb7ce35 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "delta.h"
@@ -155,11 +157,11 @@ static int input_fd, output_fd;
static const char *curr_pack;
/*
- * local_links is guarded by read_mutex, and record_local_links is read-only in
- * a thread.
+ * outgoing_links is guarded by read_mutex, and record_outgoing_links is
+ * read-only in a thread.
*/
-static struct oidset local_links = OIDSET_INIT;
-static int record_local_links;
+static struct oidset outgoing_links = OIDSET_INIT;
+static int record_outgoing_links;
static struct thread_local_data *thread_data;
static int nr_dispatched;
@@ -280,7 +282,8 @@ static unsigned check_objects(void)
max = get_max_object_index();
if (verbose)
- progress = start_delayed_progress(_("Checking objects"), max);
+ progress = start_delayed_progress(the_repository,
+ _("Checking objects"), max);
for (i = 0; i < max; i++) {
foreign_nr += check_object(get_indexed_object(i));
@@ -377,16 +380,18 @@ static const char *open_pack_file(const char *pack_name)
static void parse_pack_header(void)
{
- struct pack_header *hdr = fill(sizeof(struct pack_header));
+ unsigned char *hdr = fill(sizeof(struct pack_header));
/* Header consistency check */
- if (hdr->hdr_signature != htonl(PACK_SIGNATURE))
+ if (get_be32(hdr) != PACK_SIGNATURE)
die(_("pack signature mismatch"));
- if (!pack_version_ok(hdr->hdr_version))
+ hdr += 4;
+ if (!pack_version_ok_native(get_be32(hdr)))
die(_("pack version %"PRIu32" unsupported"),
- ntohl(hdr->hdr_version));
+ get_be32(hdr));
+ hdr += 4;
- nr_objects = ntohl(hdr->hdr_entries);
+ nr_objects = get_be32(hdr);
use(sizeof(struct pack_header));
}
@@ -812,18 +817,41 @@ static int check_collison(struct object_entry *entry)
return 0;
}
-static void record_if_local_object(const struct object_id *oid)
+static void record_outgoing_link(const struct object_id *oid)
{
- struct object_info info = OBJECT_INFO_INIT;
- if (oid_object_info_extended(the_repository, oid, &info, 0))
- /* Missing; assume it is a promisor object */
- return;
- if (info.whence == OI_PACKED && info.u.packed.pack->pack_promisor)
- return;
- oidset_insert(&local_links, oid);
+ oidset_insert(&outgoing_links, oid);
+}
+
+static void maybe_record_name_entry(const struct name_entry *entry)
+{
+ /*
+ * Checking only trees here results in a significantly faster packfile
+ * indexing, but the drawback is that if the packfile to be indexed
+ * references a local blob only directly (that is, never through a
+ * local tree), that local blob is in danger of being garbage
+ * collected. Such a situation may arise if we push local commits,
+ * including one with a change to a blob in the root tree, and then the
+ * server incorporates them into its main branch through a "rebase" or
+ * "squash" merge strategy, and then we fetch the new main branch from
+ * the server.
+ *
+ * This situation has not been observed yet - we have only noticed
+ * missing commits, not missing trees or blobs. (In fact, if it were
+ * believed that only missing commits are problematic, one could argue
+ * that we should also exclude trees during the outgoing link check;
+ * but it is safer to include them.)
+ *
+ * Due to the rarity of the situation (it has not been observed to
+ * happen in real life), and because the "penalty" in such a situation
+ * is merely to refetch the missing blob when it's needed (and this
+ * happens only once - when refetched, the blob goes into a promisor
+ * pack, so it won't be GC-ed, the tradeoff seems worth it.
+ */
+ if (S_ISDIR(entry->mode))
+ record_outgoing_link(&entry->oid);
}
-static void do_record_local_links(struct object *obj)
+static void do_record_outgoing_links(struct object *obj)
{
if (obj->type == OBJ_TREE) {
struct tree *tree = (struct tree *)obj;
@@ -837,16 +865,17 @@ static void do_record_local_links(struct object *obj)
*/
return;
while (tree_entry_gently(&desc, &entry))
- record_if_local_object(&entry.oid);
+ maybe_record_name_entry(&entry);
} else if (obj->type == OBJ_COMMIT) {
struct commit *commit = (struct commit *) obj;
struct commit_list *parents = commit->parents;
+ record_outgoing_link(get_commit_tree_oid(commit));
for (; parents; parents = parents->next)
- record_if_local_object(&parents->item->object.oid);
+ record_outgoing_link(&parents->item->object.oid);
} else if (obj->type == OBJ_TAG) {
struct tag *tag = (struct tag *) obj;
- record_if_local_object(get_tagged_oid(tag));
+ record_outgoing_link(get_tagged_oid(tag));
}
}
@@ -896,7 +925,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
free(has_data);
}
- if (strict || do_fsck_object || record_local_links) {
+ if (strict || do_fsck_object || record_outgoing_links) {
read_lock();
if (type == OBJ_BLOB) {
struct blob *blob = lookup_blob(the_repository, oid);
@@ -928,8 +957,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
die(_("fsck error in packed object"));
if (strict && fsck_walk(obj, NULL, &fsck_options))
die(_("Not all child objects of %s are reachable"), oid_to_hex(&obj->oid));
- if (record_local_links)
- do_record_local_links(obj);
+ if (record_outgoing_links)
+ do_record_outgoing_links(obj);
if (obj->type == OBJ_TREE) {
struct tree *item = (struct tree *) obj;
@@ -1223,6 +1252,7 @@ static void parse_pack_objects(unsigned char *hash)
if (verbose)
progress = start_progress(
+ the_repository,
progress_title ? progress_title :
from_stdin ? _("Receiving objects") : _("Indexing objects"),
nr_objects);
@@ -1291,7 +1321,7 @@ static void parse_pack_objects(unsigned char *hash)
* recursively checking if the resulting object is used as a base
* for some more deltas.
*/
-static void resolve_deltas(void)
+static void resolve_deltas(struct pack_idx_option *opts)
{
int i;
@@ -1303,14 +1333,14 @@ static void resolve_deltas(void)
QSORT(ref_deltas, nr_ref_deltas, compare_ref_delta_entry);
if (verbose || show_resolving_progress)
- progress = start_progress(_("Resolving deltas"),
+ progress = start_progress(the_repository,
+ _("Resolving deltas"),
nr_ref_deltas + nr_ofs_deltas);
nr_dispatched = 0;
- base_cache_limit = delta_base_cache_limit * nr_threads;
+ base_cache_limit = opts->delta_base_cache_limit * nr_threads;
if (nr_threads > 1 || getenv("GIT_FORCE_THREADS")) {
init_thread();
- work_lock();
for (i = 0; i < nr_threads; i++) {
int ret = pthread_create(&thread_data[i].thread, NULL,
threaded_second_pass, thread_data + i);
@@ -1318,7 +1348,6 @@ static void resolve_deltas(void)
die(_("unable to create thread: %s"),
strerror(ret));
}
- work_unlock();
for (i = 0; i < nr_threads; i++)
pthread_join(thread_data[i].thread, NULL);
cleanup_thread();
@@ -1532,7 +1561,7 @@ static void write_special_file(const char *suffix, const char *msg,
if (pack_name)
filename = derive_filename(pack_name, "pack", suffix, &name_buf);
else
- filename = odb_pack_name(&name_buf, hash, suffix);
+ filename = odb_pack_name(the_repository, &name_buf, hash, suffix);
fd = odb_pack_keep(filename);
if (fd < 0) {
@@ -1560,7 +1589,7 @@ static void rename_tmp_packfile(const char **final_name,
{
if (!*final_name || strcmp(*final_name, curr_name)) {
if (!*final_name)
- *final_name = odb_pack_name(name, hash, ext);
+ *final_name = odb_pack_name(the_repository, name, hash, ext);
if (finalize_object_file(curr_name, *final_name))
die(_("unable to rename temporary '*.%s' file to '%s'"),
ext, *final_name);
@@ -1605,7 +1634,8 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
if (do_fsck_object) {
struct packed_git *p;
- p = add_packed_git(final_index_name, strlen(final_index_name), 0);
+ p = add_packed_git(the_repository, final_index_name,
+ strlen(final_index_name), 0);
if (p)
install_packed_git(the_repository, p);
}
@@ -1656,6 +1686,10 @@ static int git_index_pack_config(const char *k, const char *v,
else
opts->flags &= ~WRITE_REV;
}
+ if (!strcmp(k, "core.deltabasecachelimit")) {
+ opts->delta_base_cache_limit = git_config_ulong(k, v, ctx->kvi);
+ return 0;
+ }
return git_default_config(k, v, ctx, cb);
}
@@ -1703,7 +1737,8 @@ static void read_v2_anomalous_offsets(struct packed_git *p,
static void read_idx_option(struct pack_idx_option *opts, const char *pack_name)
{
- struct packed_git *p = add_packed_git(pack_name, strlen(pack_name), 1);
+ struct packed_git *p = add_packed_git(the_repository, pack_name,
+ strlen(pack_name), 1);
if (!p)
die(_("Cannot open existing pack file '%s'"), pack_name);
@@ -1779,28 +1814,43 @@ static void repack_local_links(void)
struct strbuf line = STRBUF_INIT;
struct oidset_iter iter;
struct object_id *oid;
- char *base_name;
+ char *base_name = NULL;
- if (!oidset_size(&local_links))
+ if (!oidset_size(&outgoing_links))
return;
- base_name = mkpathdup("%s/pack/pack", repo_get_object_directory(the_repository));
+ oidset_iter_init(&outgoing_links, &iter);
+ while ((oid = oidset_iter_next(&iter))) {
+ struct object_info info = OBJECT_INFO_INIT;
+ if (oid_object_info_extended(the_repository, oid, &info, 0))
+ /* Missing; assume it is a promisor object */
+ continue;
+ if (info.whence == OI_PACKED && info.u.packed.pack->pack_promisor)
+ continue;
- strvec_push(&cmd.args, "pack-objects");
- strvec_push(&cmd.args, "--exclude-promisor-objects-best-effort");
- strvec_push(&cmd.args, base_name);
- cmd.git_cmd = 1;
- cmd.in = -1;
- cmd.out = -1;
- if (start_command(&cmd))
- die(_("could not start pack-objects to repack local links"));
+ if (!cmd.args.nr) {
+ base_name = mkpathdup(
+ "%s/pack/pack",
+ repo_get_object_directory(the_repository));
+ strvec_push(&cmd.args, "pack-objects");
+ strvec_push(&cmd.args,
+ "--exclude-promisor-objects-best-effort");
+ strvec_push(&cmd.args, base_name);
+ cmd.git_cmd = 1;
+ cmd.in = -1;
+ cmd.out = -1;
+ if (start_command(&cmd))
+ die(_("could not start pack-objects to repack local links"));
+ }
- oidset_iter_init(&local_links, &iter);
- while ((oid = oidset_iter_next(&iter))) {
if (write_in_full(cmd.in, oid_to_hex(oid), the_hash_algo->hexsz) < 0 ||
write_in_full(cmd.in, "\n", 1) < 0)
die(_("failed to feed local object to pack-objects"));
}
+
+ if (!cmd.args.nr)
+ return;
+
close(cmd.in);
out = xfdopen(cmd.out, "r");
@@ -1852,8 +1902,7 @@ int cmd_index_pack(int argc,
*/
fetch_if_missing = 0;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(index_pack_usage);
+ show_usage_if_asked(argc, argv, index_pack_usage);
disable_replace_refs();
fsck_options.walk = mark_link;
@@ -1899,7 +1948,7 @@ int cmd_index_pack(int argc,
} else if (skip_to_optional_arg(arg, "--keep", &keep_msg)) {
; /* nothing to do */
} else if (skip_to_optional_arg(arg, "--promisor", &promisor_msg)) {
- record_local_links = 1;
+ record_outgoing_links = 1;
} else if (starts_with(arg, "--threads=")) {
char *end;
nr_threads = strtoul(arg+10, &end, 0);
@@ -1909,19 +1958,11 @@ int cmd_index_pack(int argc,
warning(_("no threads support, ignoring %s"), arg);
nr_threads = 1;
}
- } else if (starts_with(arg, "--pack_header=")) {
- struct pack_header *hdr;
- char *c;
-
- hdr = (struct pack_header *)input_buffer;
- hdr->hdr_signature = htonl(PACK_SIGNATURE);
- hdr->hdr_version = htonl(strtoul(arg + 14, &c, 10));
- if (*c != ',')
- die(_("bad %s"), arg);
- hdr->hdr_entries = htonl(strtoul(c + 1, &c, 10));
- if (*c)
- die(_("bad %s"), arg);
- input_len = sizeof(*hdr);
+ } else if (skip_prefix(arg, "--pack_header=", &arg)) {
+ if (parse_pack_header_option(arg,
+ input_buffer,
+ &input_len) < 0)
+ die(_("bad --pack_header: %s"), arg);
} else if (!strcmp(arg, "-v")) {
verbose = 1;
} else if (!strcmp(arg, "--progress-title")) {
@@ -2035,7 +2076,7 @@ int cmd_index_pack(int argc,
parse_pack_objects(pack_hash);
if (report_end_of_input)
write_in_full(2, "\0", 1);
- resolve_deltas();
+ resolve_deltas(&opts);
conclude_pack(fix_thin_pack, curr_pack, pack_hash);
free(ofs_deltas);
free(ref_deltas);
diff --git a/builtin/log.c b/builtin/log.c
index 368f6580a6..e41f88945e 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -4,7 +4,9 @@
* (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -206,7 +208,6 @@ static void cmd_log_init_defaults(struct rev_info *rev,
static void set_default_decoration_filter(struct decoration_filter *decoration_filter)
{
- int i;
char *value = NULL;
struct string_list *include = decoration_filter->include_ref_pattern;
const struct string_list *config_exclude;
@@ -240,7 +241,7 @@ static void set_default_decoration_filter(struct decoration_filter *decoration_f
* No command-line or config options were given, so
* populate with sensible defaults.
*/
- for (i = 0; i < ARRAY_SIZE(ref_namespace); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(ref_namespace); i++) {
if (!ref_namespace[i].decoration)
continue;
@@ -366,7 +367,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
if (rev->line_level_traverse)
line_log_init(rev, line_cb.prefix, &line_cb.args);
- setup_pager();
+ setup_pager(the_repository);
}
static void cmd_log_init(int argc, const char **argv, const char *prefix,
@@ -528,10 +529,14 @@ static int cmd_log_walk_no_free(struct rev_info *rev)
* but we didn't actually show the commit.
*/
rev->max_count++;
- if (!rev->reflog_info) {
+ if (!rev->reflog_info && !rev->remerge_diff) {
/*
* We may show a given commit multiple times when
- * walking the reflogs.
+ * walking the reflogs. Therefore we still need it.
+ *
+ * Likewise, we potentially still need the parents
+ * of * already shown commits to determine merge
+ * bases when showing remerge diffs.
*/
free_commit_buffer(the_repository->parsed_objects,
commit);
@@ -710,14 +715,14 @@ static int show_tag_object(const struct object_id *oid, struct rev_info *rev)
unsigned long size;
enum object_type type;
char *buf = repo_read_object_file(the_repository, oid, &type, &size);
- int offset = 0;
+ unsigned long offset = 0;
if (!buf)
return error(_("could not read object %s"), oid_to_hex(oid));
assert(type == OBJ_TAG);
while (offset < size && buf[offset] != '\n') {
- int new_offset = offset + 1;
+ unsigned long new_offset = offset + 1;
const char *ident;
while (new_offset < size && buf[new_offset++] != '\n')
; /* do nothing */
@@ -1309,24 +1314,25 @@ static void print_signature(const char *signature, FILE *file)
static char *find_branch_name(struct rev_info *rev)
{
- int i, positive = -1;
struct object_id branch_oid;
const struct object_id *tip_oid;
const char *ref, *v;
char *full_ref, *branch = NULL;
+ int interesting_found = 0;
+ size_t idx;
- for (i = 0; i < rev->cmdline.nr; i++) {
+ for (size_t i = 0; i < rev->cmdline.nr; i++) {
if (rev->cmdline.rev[i].flags & UNINTERESTING)
continue;
- if (positive < 0)
- positive = i;
- else
+ if (interesting_found)
return NULL;
+ interesting_found = 1;
+ idx = i;
}
- if (positive < 0)
+ if (!interesting_found)
return NULL;
- ref = rev->cmdline.rev[positive].name;
- tip_oid = &rev->cmdline.rev[positive].item->oid;
+ ref = rev->cmdline.rev[idx].name;
+ tip_oid = &rev->cmdline.rev[idx].item->oid;
if (repo_dwim_ref(the_repository, ref, strlen(ref), &branch_oid,
&full_ref, 0) &&
skip_prefix(full_ref, "refs/heads/", &v) &&
@@ -1739,11 +1745,12 @@ struct base_tree_info {
static struct commit *get_base_commit(const struct format_config *cfg,
struct commit **list,
- int total)
+ size_t total)
{
struct commit *base = NULL;
struct commit **rev;
- int i = 0, rev_nr = 0, auto_select, die_on_failure, ret;
+ int auto_select, die_on_failure, ret;
+ size_t i = 0, rev_nr = 0;
switch (cfg->auto_base) {
case AUTO_BASE_NEVER:
@@ -1878,13 +1885,12 @@ define_commit_slab(commit_base, int);
static void prepare_bases(struct base_tree_info *bases,
struct commit *base,
struct commit **list,
- int total)
+ size_t total)
{
struct commit *commit;
struct rev_info revs;
struct diff_options diffopt;
struct commit_base commit_base;
- int i;
if (!base)
return;
@@ -1899,7 +1905,7 @@ static void prepare_bases(struct base_tree_info *bases,
repo_init_revisions(the_repository, &revs, NULL);
revs.max_parents = 1;
revs.topo_order = 1;
- for (i = 0; i < total; i++) {
+ for (size_t i = 0; i < total; i++) {
list[i]->object.flags &= ~UNINTERESTING;
add_pending_object(&revs, &list[i]->object, "rev_list");
*commit_base_at(&commit_base, list[i]) = 1;
@@ -2000,7 +2006,7 @@ int cmd_format_patch(int argc,
struct rev_info rev;
char *to_free = NULL;
struct setup_revision_opt s_r_opt;
- int nr = 0, total, i;
+ size_t nr = 0, total, i;
int use_stdout = 0;
int start_number = -1;
int just_numbers = 0;
@@ -2176,7 +2182,7 @@ int cmd_format_patch(int argc,
fmt_patch_suffix = cfg.fmt_patch_suffix;
/* Make sure "0000-$sub.patch" gives non-negative length for $sub */
- if (cfg.log.fmt_patch_name_max <= strlen("0000-") + strlen(fmt_patch_suffix))
+ if (cfg.log.fmt_patch_name_max <= cast_size_t_to_int(strlen("0000-") + strlen(fmt_patch_suffix)))
cfg.log.fmt_patch_name_max = strlen("0000-") + strlen(fmt_patch_suffix);
if (cover_from_description_arg)
@@ -2289,7 +2295,7 @@ int cmd_format_patch(int argc,
rev.commit_format = CMIT_FMT_MBOXRD;
if (use_stdout) {
- setup_pager();
+ setup_pager(the_repository);
} else if (!rev.diffopt.close_file) {
int saved;
@@ -2492,12 +2498,16 @@ int cmd_format_patch(int argc,
rev.add_signoff = cfg.do_signoff;
if (show_progress)
- progress = start_delayed_progress(_("Generating patches"), total);
- while (0 <= --nr) {
+ progress = start_delayed_progress(the_repository,
+ _("Generating patches"), total);
+ for (i = 0; i < nr; i++) {
+ size_t idx = nr - i - 1;
int shown;
- display_progress(progress, total - nr);
- commit = list[nr];
- rev.nr = total - nr + (start_number - 1);
+
+ display_progress(progress, total - idx);
+ commit = list[idx];
+ rev.nr = total - idx + (start_number - 1);
+
/* Make the second and subsequent mails replies to the first */
if (cfg.thread) {
/* Have we already had a message ID? */
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index e016b0415d..a4431429b7 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -5,7 +5,10 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "convert.h"
@@ -641,8 +644,8 @@ int cmd_ls_files(int argc,
};
int ret = 0;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(ls_files_usage, builtin_ls_files_options);
+ show_usage_with_options_if_asked(argc, argv,
+ ls_files_usage, builtin_ls_files_options);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index e17dec27b1..8de7ba7de1 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -83,7 +83,7 @@ int cmd_mailinfo(int argc,
OPT_END()
};
- setup_mailinfo(&mi);
+ setup_mailinfo(the_repository, &mi);
meta_charset.policy = CHARSET_DEFAULT;
argc = parse_options(argc, argv, prefix, options, mailinfo_usage, 0);
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index b8f7150ce9..264df6259a 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -4,6 +4,9 @@
* It just splits a mbox into a list of files: "0001" "0002" ..
* so you can process them further from there.
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "gettext.h"
#include "string-list.h"
@@ -172,7 +175,6 @@ static int split_maildir(const char *maildir, const char *dir,
char *file = NULL;
FILE *f = NULL;
int ret = -1;
- int i;
struct string_list list = STRING_LIST_INIT_DUP;
list.cmp = maildir_filename_cmp;
@@ -180,7 +182,7 @@ static int split_maildir(const char *maildir, const char *dir,
if (populate_maildir_list(&list, maildir) < 0)
goto out;
- for (i = 0; i < list.nr; i++) {
+ for (size_t i = 0; i < list.nr; i++) {
char *name;
free(file);
@@ -282,6 +284,8 @@ int cmd_mailsplit(int argc,
BUG_ON_NON_EMPTY_PREFIX(prefix);
+ show_usage_if_asked(argc, argv, git_mailsplit_usage);
+
for (argp = argv+1; *argp; argp++) {
const char *arg = *argp;
@@ -295,8 +299,6 @@ int cmd_mailsplit(int argc,
continue;
} else if ( arg[1] == 'f' ) {
nr = strtol(arg+2, NULL, 10);
- } else if ( arg[1] == 'h' ) {
- usage(git_mailsplit_usage);
} else if ( arg[1] == 'b' && !arg[2] ) {
allow_bare = 1;
} else if (!strcmp(arg, "--keep-cr")) {
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index a20c93b11a..123c81515e 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -8,7 +8,7 @@
#include "parse-options.h"
#include "commit-reach.h"
-static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
+static int show_merge_base(struct commit **rev, size_t rev_nr, int show_all)
{
struct commit_list *result = NULL, *r;
@@ -149,7 +149,7 @@ int cmd_merge_base(int argc,
struct repository *repo UNUSED)
{
struct commit **rev;
- int rev_nr = 0;
+ size_t rev_nr = 0;
int show_all = 0;
int cmdmode = 0;
int ret;
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index cb42865eb5..7e315f374b 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "diff.h"
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index a5b87ee3c5..3314fb1336 100644
--- a/builtin/merge-index.c
+++ b/builtin/merge-index.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "hex.h"
#include "read-cache-ll.h"
@@ -73,6 +75,9 @@ static void merge_all(void)
}
}
+static const char usage_string[] =
+"git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])";
+
int cmd_merge_index(int argc,
const char **argv,
const char *prefix UNUSED,
@@ -85,8 +90,10 @@ int cmd_merge_index(int argc,
*/
signal(SIGCHLD, SIG_DFL);
+ show_usage_if_asked(argc, argv, usage_string);
+
if (argc < 3)
- usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");
+ usage(usage_string);
repo_read_index(the_repository);
diff --git a/builtin/merge-ours.c b/builtin/merge-ours.c
index 1fcf53f005..97b8a792c7 100644
--- a/builtin/merge-ours.c
+++ b/builtin/merge-ours.c
@@ -7,7 +7,9 @@
*
* Pretend we resolved the heads, but declare our tree trumps everybody else.
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "builtin.h"
#include "diff.h"
@@ -21,8 +23,7 @@ int cmd_merge_ours(int argc,
const char *prefix UNUSED,
struct repository *repo UNUSED)
{
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(builtin_merge_ours_usage);
+ show_usage_if_asked(argc, argv, builtin_merge_ours_usage);
/*
* The contents of the current index becomes the tree we
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index 1dd295558b..abfc060e28 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -38,6 +38,12 @@ int cmd_merge_recursive(int argc,
if (argv[0] && ends_with(argv[0], "-subtree"))
o.subtree_shift = "";
+ if (argc == 2 && !strcmp(argv[1], "-h")) {
+ struct strbuf msg = STRBUF_INIT;
+ strbuf_addf(&msg, builtin_merge_recursive_usage, argv[0]);
+ show_usage_if_asked(argc, argv, msg.buf);
+ }
+
if (argc < 4)
usagef(builtin_merge_recursive_usage, argv[0]);
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index c5ed472967..9a6c8b4e4c 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
@@ -497,10 +498,9 @@ static int real_merge(struct merge_tree_options *o,
if (!result.clean) {
struct string_list conflicted_files = STRING_LIST_INIT_NODUP;
const char *last = NULL;
- int i;
merge_get_conflicted_files(&result, &conflicted_files);
- for (i = 0; i < conflicted_files.nr; i++) {
+ for (size_t i = 0; i < conflicted_files.nr; i++) {
const char *name = conflicted_files.items[i].string;
struct stage_info *c = conflicted_files.items[i].util;
if (!o->name_only)
@@ -584,7 +584,7 @@ int cmd_merge_tree(int argc,
if (xopts.nr && o.mode == MODE_TRIVIAL)
die(_("--trivial-merge is incompatible with all other options"));
- for (int x = 0; x < xopts.nr; x++)
+ for (size_t x = 0; x < xopts.nr; x++)
if (parse_merge_opt(&o.merge_options, xopts.v[x]))
die(_("unknown strategy option: -X%s"), xopts.v[x]);
diff --git a/builtin/merge.c b/builtin/merge.c
index 51038eaca8..ba9faf126a 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -5,7 +5,10 @@
*
* Based on git-merge.sh by Junio C Hamano.
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
@@ -498,7 +501,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
char *found_ref = NULL;
int len, early;
- strbuf_branchname(&bname, remote, 0);
+ copy_branchname(&bname, remote, 0);
remote = bname.buf;
oidclr(&branch_head, the_repository->hash_algo);
@@ -1297,8 +1300,8 @@ int cmd_merge(int argc,
void *branch_to_free;
int orig_argc = argc;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_merge_usage, builtin_merge_options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_merge_usage, builtin_merge_options);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index 85e40a4b6d..2a938466f5 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -120,7 +120,7 @@ static void read_packs_from_stdin(struct string_list *to)
static int cmd_multi_pack_index_write(int argc, const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
struct option *options;
static struct option builtin_multi_pack_index_write_options[] = {
@@ -165,7 +165,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
read_packs_from_stdin(&packs);
- ret = write_midx_file_only(opts.object_dir, &packs,
+ ret = write_midx_file_only(repo, opts.object_dir, &packs,
opts.preferred_pack,
opts.refs_snapshot, opts.flags);
@@ -176,7 +176,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
}
- ret = write_midx_file(opts.object_dir, opts.preferred_pack,
+ ret = write_midx_file(repo, opts.object_dir, opts.preferred_pack,
opts.refs_snapshot, opts.flags);
free(opts.refs_snapshot);
diff --git a/builtin/mv.c b/builtin/mv.c
index 472a278737..55a7d471dc 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -3,7 +3,9 @@
*
* Copyright (C) 2006 Johannes Schindelin
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "builtin.h"
#include "abspath.h"
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 765eb20a93..beac166b5c 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "environment.h"
#include "gettext.h"
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 676a586709..d51c021d99 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "environment.h"
#include "gettext.h"
@@ -1262,7 +1264,8 @@ static void write_pack_file(void)
struct object_entry **write_order;
if (progress > pack_to_stdout)
- progress_state = start_progress(_("Writing objects"), nr_result);
+ progress_state = start_progress(the_repository,
+ _("Writing objects"), nr_result);
ALLOC_ARRAY(written_list, to_pack.nr_objects);
write_order = compute_write_order();
@@ -1515,7 +1518,7 @@ static int want_found_object(const struct object_id *oid, int exclude,
return 0;
if (ignore_packed_keep_in_core && p->pack_keep_in_core)
return 0;
- if (has_object_kept_pack(oid, flags))
+ if (has_object_kept_pack(p->repo, oid, flags))
return 0;
}
@@ -2398,7 +2401,8 @@ static void get_object_details(void)
struct object_entry **sorted_by_offset;
if (progress)
- progress_state = start_progress(_("Counting objects"),
+ progress_state = start_progress(the_repository,
+ _("Counting objects"),
to_pack.nr_objects);
CALLOC_ARRAY(sorted_by_offset, to_pack.nr_objects);
@@ -3218,7 +3222,8 @@ static void prepare_pack(int window, int depth)
unsigned nr_done = 0;
if (progress)
- progress_state = start_progress(_("Compressing objects"),
+ progress_state = start_progress(the_repository,
+ _("Compressing objects"),
nr_deltas);
QSORT(delta_list, n, type_size_sort);
ll_find_deltas(delta_list, n, window+1, depth, &nr_done);
@@ -3613,7 +3618,7 @@ static void show_cruft_commit(struct commit *commit, void *data)
static int cruft_include_check_obj(struct object *obj, void *data UNUSED)
{
- return !has_object_kept_pack(&obj->oid, IN_CORE_KEEP_PACKS);
+ return !has_object_kept_pack(to_pack.repo, &obj->oid, IN_CORE_KEEP_PACKS);
}
static int cruft_include_check(struct commit *commit, void *data)
@@ -3646,7 +3651,8 @@ static void add_objects_in_unpacked_packs(void);
static void enumerate_cruft_objects(void)
{
if (progress)
- progress_state = start_progress(_("Enumerating cruft objects"), 0);
+ progress_state = start_progress(the_repository,
+ _("Enumerating cruft objects"), 0);
add_objects_in_unpacked_packs();
add_unreachable_loose_objects();
@@ -3672,7 +3678,8 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
revs.ignore_missing_links = 1;
if (progress)
- progress_state = start_progress(_("Enumerating cruft objects"), 0);
+ progress_state = start_progress(the_repository,
+ _("Enumerating cruft objects"), 0);
ret = add_unseen_recent_objects_to_traversal(&revs, cruft_expiration,
set_cruft_mtime, 1);
stop_progress(&progress_state);
@@ -3691,7 +3698,8 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
if (prepare_revision_walk(&revs))
die(_("revision walk setup failed"));
if (progress)
- progress_state = start_progress(_("Traversing cruft objects"), 0);
+ progress_state = start_progress(the_repository,
+ _("Traversing cruft objects"), 0);
nr_seen = 0;
traverse_commit_list(&revs, show_cruft_commit, show_cruft_object, NULL);
@@ -3844,7 +3852,8 @@ static void show_object__ma_allow_promisor(struct object *obj, const char *name,
* Quietly ignore EXPECTED missing objects. This avoids problems with
* staging them now and getting an odd error later.
*/
- if (!has_object(the_repository, &obj->oid, 0) && is_promisor_object(&obj->oid))
+ if (!has_object(the_repository, &obj->oid, 0) &&
+ is_promisor_object(to_pack.repo, &obj->oid))
return;
show_object(obj, name, data);
@@ -3913,7 +3922,9 @@ static int add_object_in_unpacked_pack(const struct object_id *oid,
static void add_objects_in_unpacked_packs(void)
{
- if (for_each_packed_object(add_object_in_unpacked_pack, NULL,
+ if (for_each_packed_object(to_pack.repo,
+ add_object_in_unpacked_pack,
+ NULL,
FOR_EACH_OBJECT_PACK_ORDER |
FOR_EACH_OBJECT_LOCAL_ONLY |
FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS |
@@ -4620,7 +4631,8 @@ int cmd_pack_objects(int argc,
prepare_packing_data(the_repository, &to_pack);
if (progress && !cruft)
- progress_state = start_progress(_("Enumerating objects"), 0);
+ progress_state = start_progress(the_repository,
+ _("Enumerating objects"), 0);
if (stdin_packs) {
/* avoids adding objects in excluded packs */
ignore_packed_keep_in_core = 1;
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index d2c1c4e5ec..3febe732f8 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -5,6 +5,7 @@
* This file is licensed under the GPL v2.
*
*/
+
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
@@ -389,7 +390,6 @@ static int cmp_remaining_objects(const void *a, const void *b)
static void sort_pack_list(struct pack_list **pl)
{
struct pack_list **ary, *p;
- int i;
size_t n = pack_list_size(*pl);
if (n < 2)
@@ -403,7 +403,7 @@ static void sort_pack_list(struct pack_list **pl)
QSORT(ary, n, cmp_remaining_objects);
/* link them back again */
- for (i = 0; i < n - 1; i++)
+ for (size_t i = 0; i < n - 1; i++)
ary[i]->next = ary[i + 1];
ary[n - 1]->next = NULL;
*pl = ary[0];
@@ -595,8 +595,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED, s
struct strbuf idx_name = STRBUF_INIT;
char buf[GIT_MAX_HEXSZ + 2]; /* hex hash + \n + \0 */
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(pack_redundant_usage);
+ show_usage_if_asked(argc, argv, pack_redundant_usage);
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
@@ -690,7 +689,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED, s
pl = red = pack_list_difference(local_packs, min);
while (pl) {
printf("%s\n%s\n",
- odb_pack_name(&idx_name, pl->pack->hash, "idx"),
+ odb_pack_name(pl->pack->repo, &idx_name, pl->pack->hash, "idx"),
pl->pack->pack_name);
pl = pl->next;
}
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index 2d83c1ed2a..4fdd68880e 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index 93b398e391..f540d8daa7 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "diff.h"
@@ -8,13 +9,13 @@
#include "parse-options.h"
#include "setup.h"
-static void flush_current_id(int patchlen, struct object_id *id, struct object_id *result)
+static void flush_current_id(size_t patchlen, struct object_id *id, struct object_id *result)
{
if (patchlen)
printf("%s %s\n", oid_to_hex(result), oid_to_hex(id));
}
-static int remove_space(char *line)
+static size_t remove_space(char *line)
{
char *src = line;
char *dst = line;
@@ -61,10 +62,11 @@ static int scan_hunk_header(const char *p, int *p_before, int *p_after)
return 1;
}
-static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
- struct strbuf *line_buf, int stable, int verbatim)
+static size_t get_one_patchid(struct object_id *next_oid, struct object_id *result,
+ struct strbuf *line_buf, int stable, int verbatim)
{
- int patchlen = 0, found_next = 0;
+ size_t patchlen = 0;
+ int found_next = 0;
int before = -1, after = -1;
int diff_is_binary = 0;
char pre_oid_str[GIT_MAX_HEXSZ + 1], post_oid_str[GIT_MAX_HEXSZ + 1];
@@ -76,7 +78,7 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
while (strbuf_getwholeline(line_buf, stdin, '\n') != EOF) {
char *line = line_buf->buf;
const char *p = line;
- int len;
+ size_t len;
/* Possibly skip over the prefix added by "log" or "format-patch" */
if (!skip_prefix(line, "commit ", &p) &&
@@ -177,7 +179,7 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
static void generate_id_list(int stable, int verbatim)
{
struct object_id oid, n, result;
- int patchlen;
+ size_t patchlen;
struct strbuf line_buf = STRBUF_INIT;
oidclr(&oid, the_repository->hash_algo);
diff --git a/builtin/prune.c b/builtin/prune.c
index 2b1de01339..1c357fffd8 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "commit.h"
#include "diff.h"
@@ -62,7 +64,8 @@ static void perform_reachability_traversal(struct rev_info *revs)
return;
if (show_progress)
- progress = start_delayed_progress(_("Checking connectivity"), 0);
+ progress = start_delayed_progress(the_repository,
+ _("Checking connectivity"), 0);
mark_reachable_objects(revs, 1, expire, progress);
stop_progress(&progress);
initialized = 1;
diff --git a/builtin/pull.c b/builtin/pull.c
index edc56907aa..9c4a00620a 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -7,6 +7,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -941,11 +942,10 @@ static int get_can_ff(struct object_id *orig_head,
static int already_up_to_date(struct object_id *orig_head,
struct oid_array *merge_heads)
{
- int i;
struct commit *ours;
ours = lookup_commit_reference(the_repository, orig_head);
- for (i = 0; i < merge_heads->nr; i++) {
+ for (size_t i = 0; i < merge_heads->nr; i++) {
struct commit_list *list = NULL;
struct commit *theirs;
int ok;
diff --git a/builtin/push.c b/builtin/push.c
index 51c609f208..90de3746b5 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -1,7 +1,9 @@
/*
* "git push"
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "advice.h"
#include "branch.h"
@@ -417,7 +419,7 @@ static int do_push(int flags,
const struct string_list *push_options,
struct remote *remote)
{
- int i, errs;
+ int errs;
struct strvec *url;
struct refspec *push_refspec = &rs;
@@ -432,7 +434,7 @@ static int do_push(int flags,
}
errs = 0;
url = push_url_of_remote(remote);
- for (i = 0; i < url->nr; i++) {
+ for (size_t i = 0; i < url->nr; i++) {
struct transport *transport =
transport_get(remote, url->v[i]);
if (flags & TRANSPORT_PUSH_OPTIONS)
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index 1b33ab66a7..32ddb6613f 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "gettext.h"
#include "object-name.h"
@@ -21,6 +22,7 @@ int cmd_range_diff(int argc,
{
struct diff_options diffopt = { NULL };
struct strvec other_arg = STRVEC_INIT;
+ struct strvec diff_merges_arg = STRVEC_INIT;
struct range_diff_options range_diff_opts = {
.creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT,
.diffopt = &diffopt,
@@ -36,6 +38,10 @@ int cmd_range_diff(int argc,
OPT_PASSTHRU_ARGV(0, "notes", &other_arg,
N_("notes"), N_("passed to 'git log'"),
PARSE_OPT_OPTARG),
+ OPT_PASSTHRU_ARGV(0, "diff-merges", &diff_merges_arg,
+ N_("style"), N_("passed to 'git log'"), 0),
+ OPT_PASSTHRU_ARGV(0, "remerge-diff", &diff_merges_arg, NULL,
+ N_("passed to 'git log'"), PARSE_OPT_NOARG),
OPT_BOOL(0, "left-only", &left_only,
N_("only emit output related to the first range")),
OPT_BOOL(0, "right-only", &right_only,
@@ -62,6 +68,12 @@ int cmd_range_diff(int argc,
if (!simple_color)
diffopt.use_color = 1;
+ /* If `--diff-merges` was specified, imply `--merges` */
+ if (diff_merges_arg.nr) {
+ range_diff_opts.include_merges = 1;
+ strvec_pushv(&other_arg, diff_merges_arg.v);
+ }
+
for (i = 0; i < argc; i++)
if (!strcmp(argv[i], "--")) {
dash_dash = i;
@@ -155,6 +167,7 @@ int cmd_range_diff(int argc,
res = show_range_diff(range1.buf, range2.buf, &range_diff_opts);
strvec_clear(&other_arg);
+ strvec_clear(&diff_merges_arg);
strbuf_release(&range1);
strbuf_release(&range2);
diff --git a/builtin/rebase.c b/builtin/rebase.c
index bbaca3c5d5..6c9eaf3788 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -3,7 +3,10 @@
*
* Copyright (c) 2018 Pratik Karki
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
@@ -1220,9 +1223,9 @@ int cmd_rebase(int argc,
};
int i;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(builtin_rebase_usage,
- builtin_rebase_options);
+ show_usage_with_options_if_asked(argc, argv,
+ builtin_rebase_usage,
+ builtin_rebase_options);
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 9d2c07f68d..0fb0266cfd 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
@@ -172,7 +174,7 @@ static int receive_pack_config(const char *var, const char *value,
char *path;
if (git_config_pathname(&path, var, value))
- return 1;
+ return -1;
strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
fsck_msg_types.len ? ',' : '=', path);
free(path);
@@ -2237,7 +2239,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
strvec_push(&child.args, alt_shallow_file);
}
- tmp_objdir = tmp_objdir_create("incoming");
+ tmp_objdir = tmp_objdir_create(the_repository, "incoming");
if (!tmp_objdir) {
if (err_fd > 0)
close(err_fd);
@@ -2626,7 +2628,7 @@ int cmd_receive_pack(int argc,
}
}
if (auto_update_server_info)
- update_server_info(0);
+ update_server_info(the_repository, 0);
clear_shallow_info(&si);
}
if (use_sideband)
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 5a0c22f2f7..95f264989b 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index 33c8ae0fc7..bd2037f27d 100644
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
@@ -202,6 +202,8 @@ int cmd_remote_ext(int argc,
{
BUG_ON_NON_EMPTY_PREFIX(prefix);
+ show_usage_if_asked(argc, argv, usage_msg);
+
if (argc != 3)
usage(usage_msg);
diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c
index ae896eda57..39908546ba 100644
--- a/builtin/remote-fd.c
+++ b/builtin/remote-fd.c
@@ -64,6 +64,7 @@ int cmd_remote_fd(int argc,
BUG_ON_NON_EMPTY_PREFIX(prefix);
+ show_usage_if_asked(argc, argv, usage_msg);
if (argc != 3)
usage(usage_msg);
diff --git a/builtin/remote.c b/builtin/remote.c
index 1ad3e70a6b..315cbb88e6 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
@@ -818,7 +820,8 @@ static int mv(int argc, const char **argv, const char *prefix,
* Count symrefs twice, since "renaming" them is done by
* deleting and recreating them in two separate passes.
*/
- progress = start_progress(_("Renaming remote references"),
+ progress = start_progress(the_repository,
+ _("Renaming remote references"),
rename.remote_branches->nr + rename.symrefs_nr);
}
for (i = 0; i < remote_branches.nr; i++) {
@@ -1403,12 +1406,42 @@ static int show(int argc, const char **argv, const char *prefix,
return result;
}
+static void report_set_head_auto(const char *remote, const char *head_name,
+ struct strbuf *b_local_head, int was_detached) {
+ struct strbuf buf_prefix = STRBUF_INIT;
+ const char *prev_head = NULL;
+
+ strbuf_addf(&buf_prefix, "refs/remotes/%s/", remote);
+ skip_prefix(b_local_head->buf, buf_prefix.buf, &prev_head);
+
+ if (prev_head && !strcmp(prev_head, head_name))
+ printf(_("'%s/HEAD' is unchanged and points to '%s'\n"),
+ remote, head_name);
+ else if (prev_head)
+ printf(_("'%s/HEAD' has changed from '%s' and now points to '%s'\n"),
+ remote, prev_head, head_name);
+ else if (!b_local_head->len)
+ printf(_("'%s/HEAD' is now created and points to '%s'\n"),
+ remote, head_name);
+ else if (was_detached && b_local_head->len)
+ printf(_("'%s/HEAD' was detached at '%s' and now points to '%s'\n"),
+ remote, b_local_head->buf, head_name);
+ else
+ printf(_("'%s/HEAD' used to point to '%s' "
+ "(which is not a remote branch), but now points to '%s'\n"),
+ remote, b_local_head->buf, head_name);
+ strbuf_release(&buf_prefix);
+}
+
static int set_head(int argc, const char **argv, const char *prefix,
struct repository *repo UNUSED)
{
- int i, opt_a = 0, opt_d = 0, result = 0;
- struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
+ int i, opt_a = 0, opt_d = 0, result = 0, was_detached;
+ struct strbuf b_head = STRBUF_INIT, b_remote_head = STRBUF_INIT,
+ b_local_head = STRBUF_INIT;
char *head_name = NULL;
+ struct ref_store *refs = get_main_ref_store(the_repository);
+ struct remote *remote;
struct option options[] = {
OPT_BOOL('a', "auto", &opt_a,
@@ -1419,8 +1452,10 @@ static int set_head(int argc, const char **argv, const char *prefix,
};
argc = parse_options(argc, argv, prefix, options,
builtin_remote_sethead_usage, 0);
- if (argc)
- strbuf_addf(&buf, "refs/remotes/%s/HEAD", argv[0]);
+ if (argc) {
+ strbuf_addf(&b_head, "refs/remotes/%s/HEAD", argv[0]);
+ remote = remote_get(argv[0]);
+ }
if (!opt_a && !opt_d && argc == 2) {
head_name = xstrdup(argv[1]);
@@ -1439,25 +1474,39 @@ static int set_head(int argc, const char **argv, const char *prefix,
head_name = xstrdup(states.heads.items[0].string);
free_remote_ref_states(&states);
} else if (opt_d && !opt_a && argc == 1) {
- if (refs_delete_ref(get_main_ref_store(the_repository), NULL, buf.buf, NULL, REF_NO_DEREF))
- result |= error(_("Could not delete %s"), buf.buf);
+ if (refs_delete_ref(refs, NULL, b_head.buf, NULL, REF_NO_DEREF))
+ result |= error(_("Could not delete %s"), b_head.buf);
} else
usage_with_options(builtin_remote_sethead_usage, options);
- if (head_name) {
- strbuf_addf(&buf2, "refs/remotes/%s/%s", argv[0], head_name);
- /* make sure it's valid */
- if (!refs_ref_exists(get_main_ref_store(the_repository), buf2.buf))
- result |= error(_("Not a valid ref: %s"), buf2.buf);
- else if (refs_update_symref(get_main_ref_store(the_repository), buf.buf, buf2.buf, "remote set-head"))
- result |= error(_("Could not setup %s"), buf.buf);
- else if (opt_a)
- printf("%s/HEAD set to %s\n", argv[0], head_name);
- free(head_name);
+ if (!head_name)
+ goto cleanup;
+ strbuf_addf(&b_remote_head, "refs/remotes/%s/%s", argv[0], head_name);
+ if (!refs_ref_exists(refs, b_remote_head.buf)) {
+ result |= error(_("Not a valid ref: %s"), b_remote_head.buf);
+ goto cleanup;
+ }
+ was_detached = refs_update_symref_extended(refs, b_head.buf, b_remote_head.buf,
+ "remote set-head", &b_local_head, 0);
+ if (was_detached == -1) {
+ result |= error(_("Could not set up %s"), b_head.buf);
+ goto cleanup;
+ }
+ if (opt_a)
+ report_set_head_auto(argv[0], head_name, &b_local_head, was_detached);
+ if (remote->follow_remote_head == FOLLOW_REMOTE_ALWAYS) {
+ struct strbuf config_name = STRBUF_INIT;
+ strbuf_addf(&config_name,
+ "remote.%s.followremotehead", remote->name);
+ git_config_set(config_name.buf, "warn");
+ strbuf_release(&config_name);
}
- strbuf_release(&buf);
- strbuf_release(&buf2);
+cleanup:
+ free(head_name);
+ strbuf_release(&b_head);
+ strbuf_release(&b_remote_head);
+ strbuf_release(&b_local_head);
return result;
}
diff --git a/builtin/repack.c b/builtin/repack.c
index d6bb37e84a..81d13630ea 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "dir.h"
@@ -404,7 +406,7 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
* {type -> existing pack order} ordering when computing deltas instead
* of a {type -> size} ordering, which may produce better deltas.
*/
- for_each_packed_object(write_oid, &cmd,
+ for_each_packed_object(the_repository, write_oid, &cmd,
FOR_EACH_OBJECT_PROMISOR_ONLY);
if (cmd.in == -1) {
@@ -1563,13 +1565,13 @@ int cmd_repack(int argc,
}
if (run_update_server_info)
- update_server_info(0);
+ update_server_info(the_repository, 0);
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) {
unsigned flags = 0;
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL, 0))
flags |= MIDX_WRITE_INCREMENTAL;
- write_midx_file(repo_get_object_directory(the_repository),
+ write_midx_file(the_repository, repo_get_object_directory(the_repository),
NULL, NULL, flags);
}
diff --git a/builtin/replay.c b/builtin/replay.c
index 2d12a4e403..1afc6d1ee0 100644
--- a/builtin/replay.c
+++ b/builtin/replay.c
@@ -2,9 +2,11 @@
* "git replay" builtin command
*/
+#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
-#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "environment.h"
#include "hex.h"
diff --git a/builtin/rerere.c b/builtin/rerere.c
index f7143c3f5d..41127e24e5 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
@@ -55,7 +56,7 @@ int cmd_rerere(int argc,
struct repository *repo UNUSED)
{
struct string_list merge_rr = STRING_LIST_INIT_DUP;
- int i, autoupdate = -1, flags = 0;
+ int autoupdate = -1, flags = 0;
struct option options[] = {
OPT_SET_INT(0, "rerere-autoupdate", &autoupdate,
@@ -98,11 +99,11 @@ int cmd_rerere(int argc,
if (setup_rerere(the_repository, &merge_rr,
flags | RERERE_READONLY) < 0)
return 0;
- for (i = 0; i < merge_rr.nr; i++)
+ for (size_t i = 0; i < merge_rr.nr; i++)
printf("%s\n", merge_rr.items[i].string);
} else if (!strcmp(argv[0], "remaining")) {
rerere_remaining(the_repository, &merge_rr);
- for (i = 0; i < merge_rr.nr; i++) {
+ for (size_t i = 0; i < merge_rr.nr; i++) {
if (merge_rr.items[i].util != RERERE_RESOLVED)
printf("%s\n", merge_rr.items[i].string);
else
@@ -114,7 +115,7 @@ int cmd_rerere(int argc,
if (setup_rerere(the_repository, &merge_rr,
flags | RERERE_READONLY) < 0)
return 0;
- for (i = 0; i < merge_rr.nr; i++) {
+ for (size_t i = 0; i < merge_rr.nr; i++) {
const char *path = merge_rr.items[i].string;
const struct rerere_id *id = merge_rr.items[i].util;
if (diff_two(rerere_path(id, "preimage"), path, path, path))
diff --git a/builtin/reset.c b/builtin/reset.c
index 7154f88826..73b4537a9a 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -7,7 +7,9 @@
*
* Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 3078787115..beb8c2529d 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "commit.h"
@@ -121,7 +123,7 @@ static inline void finish_object__ma(struct object *obj)
return;
case MA_ALLOW_PROMISOR:
- if (is_promisor_object(&obj->oid))
+ if (is_promisor_object(the_repository, &obj->oid))
return;
die("unexpected missing %s object '%s'",
type_name(obj->type), oid_to_hex(&obj->oid));
@@ -540,8 +542,7 @@ int cmd_rev_list(int argc,
const char *show_progress = NULL;
int ret = 0;
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(rev_list_usage);
+ show_usage_if_asked(argc, argv, rev_list_usage);
git_config(git_default_config, NULL);
repo_init_revisions(the_repository, &revs, prefix);
@@ -733,7 +734,8 @@ int cmd_rev_list(int argc,
revs.limited = 1;
if (show_progress)
- progress = start_delayed_progress(show_progress, 0);
+ progress = start_delayed_progress(the_repository,
+ show_progress, 0);
if (use_bitmap_index) {
if (!try_bitmap_count(&revs, filter_provided_objects))
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 8401b4d7ab..428c866c05 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -3,7 +3,10 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
@@ -710,6 +713,8 @@ int cmd_rev_parse(int argc,
int seen_end_of_options = 0;
enum format_type format = FORMAT_DEFAULT;
+ show_usage_if_asked(argc, argv, builtin_rev_parse_usage);
+
if (argc > 1 && !strcmp("--parseopt", argv[1]))
return cmd_parseopt(argc - 1, argv + 1, prefix);
diff --git a/builtin/revert.c b/builtin/revert.c
index b7917dddd3..aca6c293cd 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "builtin.h"
#include "parse-options.h"
diff --git a/builtin/rm.c b/builtin/rm.c
index eaff027258..12ae086a55 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -3,7 +3,10 @@
*
* Copyright (C) Linus Torvalds 2006
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 59b626aae8..8d461008e2 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -317,7 +317,7 @@ int cmd_send_pack(int argc,
set_ref_status_for_push(remote_refs, args.send_mirror,
args.force_update);
- ret = send_pack(&args, fd, conn, remote_refs, &extra_have);
+ ret = send_pack(the_repository, &args, fd, conn, remote_refs, &extra_have);
if (helper_status)
print_helper_status(remote_refs);
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index c86b75d981..30075b67be 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "commit.h"
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index cd6bdf63bc..fce6b404e9 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "environment.h"
diff --git a/builtin/show-index.c b/builtin/show-index.c
index f164c01bbe..756d632b51 100644
--- a/builtin/show-index.c
+++ b/builtin/show-index.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "gettext.h"
#include "hash.h"
@@ -38,6 +40,15 @@ int cmd_show_index(int argc,
repo_set_hash_algo(the_repository, hash_algo);
}
+ /*
+ * Fallback to SHA1 if we are running outside of a repository.
+ *
+ * TODO: Figure out and implement a way to detect the hash algorithm in use by the
+ * the index file passed in and use that instead.
+ */
+ if (!the_hash_algo)
+ repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
+
hashsz = the_hash_algo->rawsz;
if (fread(top_index, 2 * 4, 1, stdin) != 1)
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 34af5b2590..14dcace5f8 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "dir.h"
diff --git a/builtin/stash.c b/builtin/stash.c
index c212b1c0b2..dbaa999cf1 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -873,9 +874,8 @@ static void diff_include_untracked(const struct stash_info *info, struct diff_op
struct tree *tree[ARRAY_SIZE(oid)];
struct tree_desc tree_desc[ARRAY_SIZE(oid)];
struct unpack_trees_options unpack_tree_opt = { 0 };
- int i;
- for (i = 0; i < ARRAY_SIZE(oid); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(oid); i++) {
tree[i] = parse_tree_indirect(oid[i]);
if (parse_tree(tree[i]) < 0)
die(_("failed to parse tree"));
@@ -1557,12 +1557,11 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
repo_read_index_preload(the_repository, NULL, 0);
if (!include_untracked && ps->nr) {
- int i;
char *ps_matched = xcalloc(ps->nr, 1);
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(the_repository->index);
- for (i = 0; i < the_repository->index->cache_nr; i++)
+ for (size_t i = 0; i < the_repository->index->cache_nr; i++)
ce_path_match(the_repository->index, the_repository->index->cache[i], ps,
ps_matched);
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 19e5878381..f9b970f8a6 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
#include "environment.h"
@@ -194,7 +195,7 @@ static int module_list_compute(const char **argv,
struct pathspec *pathspec,
struct module_list *list)
{
- int i, result = 0;
+ int result = 0;
char *ps_matched = NULL;
parse_pathspec(pathspec, 0,
@@ -207,7 +208,7 @@ static int module_list_compute(const char **argv,
if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
- for (i = 0; i < the_repository->index->cache_nr; i++) {
+ for (size_t i = 0; i < the_repository->index->cache_nr; i++) {
const struct cache_entry *ce = the_repository->index->cache[i];
if (!match_pathspec(the_repository->index, pathspec, ce->name, ce_namelen(ce),
@@ -3396,7 +3397,6 @@ static void die_on_index_match(const char *path, int force)
die(_("index file corrupt"));
if (ps.nr) {
- int i;
char *ps_matched = xcalloc(ps.nr, 1);
/* TODO: audit for interaction with sparse-index. */
@@ -3406,7 +3406,7 @@ static void die_on_index_match(const char *path, int force)
* Since there is only one pathspec, we just need to
* check ps_matched[0] to know if a cache entry matched.
*/
- for (i = 0; i < the_repository->index->cache_nr; i++) {
+ for (size_t i = 0; i < the_repository->index->cache_nr; i++) {
ce_path_match(the_repository->index, the_repository->index->cache[i], &ps,
ps_matched);
diff --git a/builtin/tag.c b/builtin/tag.c
index 5e1f904d35..e8a344b926 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -5,7 +5,10 @@
* Carlos Rica <jasampler@gmail.com>
* Based on git-tag.sh and mktag.c by Linus Torvalds.
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -447,17 +450,6 @@ static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
return 0;
}
-static int strbuf_check_tag_ref(struct strbuf *sb, const char *name)
-{
- if (name[0] == '-')
- return -1;
-
- strbuf_reset(sb);
- strbuf_addf(sb, "refs/tags/%s", name);
-
- return check_refname_format(sb->buf, 0);
-}
-
int cmd_tag(int argc,
const char **argv,
const char *prefix,
@@ -650,7 +642,7 @@ int cmd_tag(int argc,
if (repo_get_oid(the_repository, object_ref, &object))
die(_("Failed to resolve '%s' as a valid ref."), object_ref);
- if (strbuf_check_tag_ref(&ref, tag))
+ if (check_tag_ref(&ref, tag))
die(_("'%s' is not a valid tag name."), tag);
if (refs_read_ref(get_main_ref_store(the_repository), ref.buf, &prev))
@@ -706,7 +698,6 @@ int cmd_tag(int argc,
cleanup:
ref_sorting_release(sorting);
ref_filter_clear(&filter);
- ref_format_clear(&format);
strbuf_release(&buf);
strbuf_release(&ref);
strbuf_release(&reflog_msg);
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 6da2825753..fb5fcbc40a 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -26,6 +26,9 @@ static char *create_temp_file(struct object_id *oid)
return path;
}
+static const char usage_msg[] =
+"git unpack-file <blob>";
+
int cmd_unpack_file(int argc,
const char **argv,
const char *prefix UNUSED,
@@ -33,8 +36,9 @@ int cmd_unpack_file(int argc,
{
struct object_id oid;
- if (argc != 2 || !strcmp(argv[1], "-h"))
- usage("git unpack-file <blob>");
+ show_usage_if_asked(argc, argv, usage_msg);
+ if (argc != 2)
+ usage(usage_msg);
if (repo_get_oid(the_repository, argv[1], &oid))
die("Not a valid object name %s", argv[1]);
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 02b8d02f63..f6b9825fb0 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "bulk-checkin.h"
#include "config.h"
@@ -16,6 +18,7 @@
#include "progress.h"
#include "decorate.h"
#include "fsck.h"
+#include "packfile.h"
static int dry_run, quiet, recover, has_errors, strict;
static const char unpack_usage[] = "git unpack-objects [-n] [-q] [-r] [--strict]";
@@ -576,19 +579,21 @@ static void unpack_one(unsigned nr)
static void unpack_all(void)
{
int i;
- struct pack_header *hdr = fill(sizeof(struct pack_header));
-
- nr_objects = ntohl(hdr->hdr_entries);
+ unsigned char *hdr = fill(sizeof(struct pack_header));
- if (ntohl(hdr->hdr_signature) != PACK_SIGNATURE)
+ if (get_be32(hdr) != PACK_SIGNATURE)
die("bad pack file");
- if (!pack_version_ok(hdr->hdr_version))
+ hdr += 4;
+ if (!pack_version_ok_native(get_be32(hdr)))
die("unknown pack file version %"PRIu32,
- ntohl(hdr->hdr_version));
+ get_be32(hdr));
+ hdr += 4;
+ nr_objects = get_be32(hdr);
use(sizeof(struct pack_header));
if (!quiet)
- progress = start_progress(_("Unpacking objects"), nr_objects);
+ progress = start_progress(the_repository,
+ _("Unpacking objects"), nr_objects);
CALLOC_ARRAY(obj_list, nr_objects);
begin_odb_transaction();
for (i = 0; i < nr_objects; i++) {
@@ -617,6 +622,8 @@ int cmd_unpack_objects(int argc,
quiet = !isatty(2);
+ show_usage_if_asked(argc, argv, unpack_usage);
+
for (i = 1 ; i < argc; i++) {
const char *arg = argv[i];
@@ -642,19 +649,10 @@ int cmd_unpack_objects(int argc,
fsck_set_msg_types(&fsck_options, arg);
continue;
}
- if (starts_with(arg, "--pack_header=")) {
- struct pack_header *hdr;
- char *c;
-
- hdr = (struct pack_header *)buffer;
- hdr->hdr_signature = htonl(PACK_SIGNATURE);
- hdr->hdr_version = htonl(strtoul(arg + 14, &c, 10));
- if (*c != ',')
- die("bad %s", arg);
- hdr->hdr_entries = htonl(strtoul(c + 1, &c, 10));
- if (*c)
- die("bad %s", arg);
- len = sizeof(*hdr);
+ if (skip_prefix(arg, "--pack_header=", &arg)) {
+ if (parse_pack_header_option(arg,
+ buffer, &len) < 0)
+ die(_("bad --pack_header: %s"), arg);
continue;
}
if (skip_prefix(arg, "--max-input-size=", &arg)) {
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 45b4a8b555..b2f6b1a3fb 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -3,7 +3,10 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "bulk-checkin.h"
#include "config.h"
@@ -1042,8 +1045,8 @@ int cmd_update_index(int argc,
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(update_index_usage, options);
+ show_usage_with_options_if_asked(argc, argv,
+ update_index_usage, options);
git_config(git_default_config, NULL);
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 670e7812d6..4d35bdc4b4 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c
index 6769611a02..47a3f0bdd9 100644
--- a/builtin/update-server-info.c
+++ b/builtin/update-server-info.c
@@ -27,5 +27,5 @@ int cmd_update_server_info(int argc,
if (argc > 0)
usage_with_options(update_server_info_usage, options);
- return !!update_server_info(force);
+ return !!update_server_info(the_repository, force);
}
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 9e9343f121..97d7c9522f 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -27,7 +27,8 @@ int cmd_upload_archive_writer(int argc,
const char *arg_cmd = "argument ";
int ret;
- if (argc != 2 || !strcmp(argv[1], "-h"))
+ show_usage_if_asked(argc, argv, upload_archive_usage);
+ if (argc != 2)
usage(upload_archive_usage);
if (!enter_repo(argv[1], 0))
@@ -92,8 +93,7 @@ struct repository *repo UNUSED)
BUG_ON_NON_EMPTY_PREFIX(prefix);
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(upload_archive_usage);
+ show_usage_if_asked(argc, argv, upload_archive_usage);
/*
* Set up sideband subprocess.
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 3b6c83fbce..c2bbc035ab 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "exec-cmd.h"
#include "gettext.h"
@@ -39,6 +41,7 @@ int cmd_upload_pack(int argc,
N_("interrupt transfer after <n> seconds of inactivity")),
OPT_END()
};
+ unsigned enter_repo_flags = ENTER_REPO_ANY_OWNER_OK;
packet_trace_identity("upload-pack");
disable_replace_refs();
@@ -54,15 +57,17 @@ int cmd_upload_pack(int argc,
dir = argv[0];
- if (!enter_repo(dir, strict))
+ if (strict)
+ enter_repo_flags |= ENTER_REPO_STRICT;
+ if (!enter_repo(dir, enter_repo_flags))
die("'%s' does not appear to be a git repository", dir);
switch (determine_protocol_version_server()) {
case protocol_v2:
if (advertise_refs)
- protocol_v2_advertise_capabilities();
+ protocol_v2_advertise_capabilities(the_repository);
else
- protocol_v2_serve_loop(stateless_rpc);
+ protocol_v2_serve_loop(the_repository, stateless_rpc);
break;
case protocol_v1:
/*
diff --git a/builtin/var.c b/builtin/var.c
index 2ecaed51b4..ada642a9fe 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -3,7 +3,9 @@
*
* Copyright (C) Eric Biederman, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "attr.h"
@@ -40,7 +42,7 @@ static char *sequence_editor(int ident_flag UNUSED)
static char *pager(int ident_flag UNUSED)
{
- const char *pgm = git_pager(1);
+ const char *pgm = git_pager(the_repository, 1);
if (!pgm)
pgm = "cat";
@@ -178,10 +180,9 @@ static void list_vars(void)
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++)
+ for (size_t i = 0; i < list.nr; i++)
printf("%s=%s\n", ptr->name, list.items[i].string);
string_list_clear(&list, 0);
} else {
@@ -220,6 +221,7 @@ int cmd_var(int argc,
const struct git_var *git_var;
char *val;
+ show_usage_if_asked(argc, argv, var_usage);
if (argc != 2)
usage(var_usage);
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index a7f20618ff..f6b97048a5 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -69,6 +69,5 @@ int cmd_verify_tag(int argc,
if (format.format)
pretty_print_ref(name, &oid, &format);
}
- ref_format_clear(&format);
return had_error;
}
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 824dd71d64..c043d4d523 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -1,4 +1,6 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
@@ -120,12 +122,14 @@ struct add_opts {
int quiet;
int checkout;
int orphan;
+ int relative_paths;
const char *keep_locked;
};
static int show_only;
static int verbose;
static int guess_remote;
+static int use_relative_paths;
static timestamp_t expire;
static int git_worktree_config(const char *var, const char *value,
@@ -134,6 +138,9 @@ static int git_worktree_config(const char *var, const char *value,
if (!strcmp(var, "worktree.guessremote")) {
guess_remote = git_config_bool(var, value);
return 0;
+ } else if (!strcmp(var, "worktree.userelativepaths")) {
+ use_relative_paths = git_config_bool(var, value);
+ return 0;
}
return git_default_config(var, value, ctx, cb);
@@ -415,8 +422,7 @@ static int add_worktree(const char *path, const char *refname,
const struct add_opts *opts)
{
struct strbuf sb_git = STRBUF_INIT, sb_repo = STRBUF_INIT;
- struct strbuf sb = STRBUF_INIT, sb_tmp = STRBUF_INIT;
- struct strbuf sb_path_realpath = STRBUF_INIT, sb_repo_realpath = STRBUF_INIT;
+ struct strbuf sb = STRBUF_INIT;
const char *name;
struct strvec child_env = STRVEC_INIT;
unsigned int counter = 0;
@@ -434,7 +440,7 @@ static int add_worktree(const char *path, const char *refname,
worktrees = NULL;
/* is 'refname' a branch or commit? */
- if (!opts->detach && !strbuf_check_branch_ref(&symref, refname) &&
+ if (!opts->detach && !check_branch_ref(&symref, refname) &&
refs_ref_exists(get_main_ref_store(the_repository), symref.buf)) {
is_branch = 1;
if (!opts->force)
@@ -492,10 +498,7 @@ static int add_worktree(const char *path, const char *refname,
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/gitdir", sb_repo.buf);
- strbuf_realpath(&sb_path_realpath, path, 1);
- strbuf_realpath(&sb_repo_realpath, sb_repo.buf, 1);
- write_file(sb.buf, "%s/.git", relative_path(sb_path_realpath.buf, sb_repo_realpath.buf, &sb_tmp));
- write_file(sb_git.buf, "gitdir: %s", relative_path(sb_repo_realpath.buf, sb_path_realpath.buf, &sb_tmp));
+ write_worktree_linking_files(sb_git, sb, opts->relative_paths);
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/commondir", sb_repo.buf);
write_file(sb.buf, "../..");
@@ -579,12 +582,9 @@ done:
strvec_clear(&child_env);
strbuf_release(&sb);
- strbuf_release(&sb_tmp);
strbuf_release(&symref);
strbuf_release(&sb_repo);
- strbuf_release(&sb_repo_realpath);
strbuf_release(&sb_git);
- strbuf_release(&sb_path_realpath);
strbuf_release(&sb_name);
free_worktree(wt);
return ret;
@@ -607,7 +607,7 @@ static void print_preparing_worktree_line(int detach,
fprintf_ln(stderr, _("Preparing worktree (new branch '%s')"), new_branch);
} else {
struct strbuf s = STRBUF_INIT;
- if (!detach && !strbuf_check_branch_ref(&s, branch) &&
+ if (!detach && !check_branch_ref(&s, branch) &&
refs_ref_exists(get_main_ref_store(the_repository), s.buf))
fprintf_ln(stderr, _("Preparing worktree (checking out '%s')"),
branch);
@@ -748,7 +748,7 @@ static char *dwim_branch(const char *path, char **new_branch)
char *branchname = xstrndup(s, n);
struct strbuf ref = STRBUF_INIT;
- branch_exists = !strbuf_check_branch_ref(&ref, branchname) &&
+ branch_exists = !check_branch_ref(&ref, branchname) &&
refs_ref_exists(get_main_ref_store(the_repository),
ref.buf);
strbuf_release(&ref);
@@ -798,12 +798,15 @@ static int add(int ac, const char **av, const char *prefix,
PARSE_OPT_NOARG | PARSE_OPT_OPTARG),
OPT_BOOL(0, "guess-remote", &guess_remote,
N_("try to match the new branch name with a remote-tracking branch")),
+ OPT_BOOL(0, "relative-paths", &opts.relative_paths,
+ N_("use relative paths for worktrees")),
OPT_END()
};
int ret;
memset(&opts, 0, sizeof(opts));
opts.checkout = 1;
+ opts.relative_paths = use_relative_paths;
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");
@@ -842,7 +845,7 @@ static int add(int ac, const char **av, const char *prefix,
new_branch = new_branch_force;
if (!opts.force &&
- !strbuf_check_branch_ref(&symref, new_branch) &&
+ !check_branch_ref(&symref, new_branch) &&
refs_ref_exists(get_main_ref_store(the_repository), symref.buf))
die_if_checked_out(symref.buf, 0);
strbuf_release(&symref);
@@ -1195,6 +1198,8 @@ static int move_worktree(int ac, const char **av, const char *prefix,
OPT__FORCE(&force,
N_("force move even if worktree is dirty or locked"),
PARSE_OPT_NOCOMPLETE),
+ OPT_BOOL(0, "relative-paths", &use_relative_paths,
+ N_("use relative paths for worktrees")),
OPT_END()
};
struct worktree **worktrees, *wt;
@@ -1247,7 +1252,7 @@ static int move_worktree(int ac, const char **av, const char *prefix,
if (rename(wt->path, dst.buf) == -1)
die_errno(_("failed to move '%s' to '%s'"), wt->path, dst.buf);
- update_worktree_location(wt, dst.buf);
+ update_worktree_location(wt, dst.buf, use_relative_paths);
strbuf_release(&dst);
free_worktrees(worktrees);
@@ -1390,6 +1395,8 @@ static int repair(int ac, const char **av, const char *prefix,
const char **p;
const char *self[] = { ".", NULL };
struct option options[] = {
+ OPT_BOOL(0, "relative-paths", &use_relative_paths,
+ N_("use relative paths for worktrees")),
OPT_END()
};
int rc = 0;
@@ -1397,8 +1404,8 @@ static int repair(int ac, const char **av, const char *prefix,
ac = parse_options(ac, av, prefix, options, git_worktree_repair_usage, 0);
p = ac > 0 ? av : self;
for (; *p; p++)
- repair_worktree_at_path(*p, report_repair, &rc);
- repair_worktrees(report_repair, &rc);
+ repair_worktree_at_path(*p, report_repair, &rc, use_relative_paths);
+ repair_worktrees(report_repair, &rc, use_relative_paths);
return rc;
}
diff --git a/bulk-checkin.c b/bulk-checkin.c
index 2753d5bbe4..5044cb7fa0 100644
--- a/bulk-checkin.c
+++ b/bulk-checkin.c
@@ -3,6 +3,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "bulk-checkin.h"
@@ -271,7 +272,7 @@ static int deflate_blob_to_pack(struct bulk_checkin_packfile *state,
OBJ_BLOB, size);
the_hash_algo->init_fn(&ctx);
the_hash_algo->update_fn(&ctx, obuf, header_len);
- the_hash_algo->init_fn(&checkpoint.ctx);
+ the_hash_algo->unsafe_init_fn(&checkpoint.ctx);
/* Note: idx is non-NULL when we are writing */
if ((flags & HASH_WRITE_OBJECT) != 0)
@@ -332,7 +333,7 @@ void prepare_loose_object_bulk_checkin(void)
if (!odb_transaction_nesting || bulk_fsync_objdir)
return;
- bulk_fsync_objdir = tmp_objdir_create("bulk-fsync");
+ bulk_fsync_objdir = tmp_objdir_create(the_repository, "bulk-fsync");
if (bulk_fsync_objdir)
tmp_objdir_replace_primary_odb(bulk_fsync_objdir, 0);
}
diff --git a/bundle-uri.c b/bundle-uri.c
index 0df66e2872..744257c49c 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "bundle-uri.h"
@@ -367,6 +368,10 @@ static int unbundle_from_file(struct repository *r, const char *file)
struct string_list_item *refname;
struct strbuf bundle_ref = STRBUF_INIT;
size_t bundle_prefix_len;
+ struct unbundle_opts opts = {
+ .flags = VERIFY_BUNDLE_QUIET |
+ (fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0),
+ };
bundle_fd = read_bundle_header(file, &header);
if (bundle_fd < 0) {
@@ -379,8 +384,7 @@ static int unbundle_from_file(struct repository *r, const char *file)
* a reachable ref pointing to the new tips, which will reach
* the prerequisite commits.
*/
- result = unbundle(r, &header, bundle_fd, NULL,
- VERIFY_BUNDLE_QUIET | (fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0));
+ result = unbundle(r, &header, bundle_fd, NULL, &opts);
if (result) {
result = 1;
goto cleanup;
diff --git a/bundle.c b/bundle.c
index 4773b51eb1..f18f98fec9 100644
--- a/bundle.c
+++ b/bundle.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "lockfile.h"
@@ -420,36 +421,6 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)
e->name);
goto skip_write_ref;
}
- /*
- * If you run "git bundle create bndl v1.0..v2.0", the
- * name of the positive ref is "v2.0" but that is the
- * commit that is referenced by the tag, and not the tag
- * itself.
- */
- if (!oideq(&oid, &e->item->oid)) {
- /*
- * Is this the positive end of a range expressed
- * in terms of a tag (e.g. v2.0 from the range
- * "v1.0..v2.0")?
- */
- struct commit *one = lookup_commit_reference(revs->repo, &oid);
- struct object *obj;
-
- if (e->item == &(one->object)) {
- /*
- * Need to include e->name as an
- * independent ref to the pack-objects
- * input, so that the tag is included
- * in the output; otherwise we would
- * end up triggering "empty bundle"
- * error.
- */
- obj = parse_object_or_die(&oid, e->name);
- obj->flags |= SHOWN;
- add_pending_object(revs, obj, e->name);
- }
- goto skip_write_ref;
- }
ref_count++;
write_or_die(bundle_fd, oid_to_hex(&e->item->oid), the_hash_algo->hexsz);
@@ -628,11 +599,15 @@ out:
int unbundle(struct repository *r, struct bundle_header *header,
int bundle_fd, struct strvec *extra_index_pack_args,
- enum verify_bundle_flags flags)
+ struct unbundle_opts *opts)
{
struct child_process ip = CHILD_PROCESS_INIT;
+ struct unbundle_opts opts_fallback = { 0 };
+
+ if (!opts)
+ opts = &opts_fallback;
- if (verify_bundle(r, header, flags))
+ if (verify_bundle(r, header, opts->flags))
return -1;
strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL);
@@ -641,8 +616,9 @@ int unbundle(struct repository *r, struct bundle_header *header,
if (header->filter.choice)
strvec_push(&ip.args, "--promisor=from-bundle");
- if (flags & VERIFY_BUNDLE_FSCK)
- strvec_push(&ip.args, "--fsck-objects");
+ if (opts->flags & VERIFY_BUNDLE_FSCK)
+ strvec_pushf(&ip.args, "--fsck-objects%s",
+ opts->fsck_msg_types ? opts->fsck_msg_types : "");
if (extra_index_pack_args)
strvec_pushv(&ip.args, extra_index_pack_args->v);
diff --git a/bundle.h b/bundle.h
index 5ccc9a061a..a80aa8ad9b 100644
--- a/bundle.h
+++ b/bundle.h
@@ -39,6 +39,17 @@ enum verify_bundle_flags {
int verify_bundle(struct repository *r, struct bundle_header *header,
enum verify_bundle_flags flags);
+struct unbundle_opts {
+ enum verify_bundle_flags flags;
+ /*
+ * fsck_msg_types may optionally contain fsck message severity
+ * configuration. If present, this configuration gets directly appended
+ * to a '--fsck-objects' option and therefore must be prefixed with '='.
+ * (E.g. "=missingEmail=ignore,gitmodulesUrl=ignore")
+ */
+ const char *fsck_msg_types;
+};
+
/**
* Unbundle after reading the header with read_bundle_header().
*
@@ -49,12 +60,12 @@ int verify_bundle(struct repository *r, struct bundle_header *header,
* (e.g. "-v" for verbose/progress), NULL otherwise. The provided
* "extra_index_pack_args" (if any) will be strvec_clear()'d for you.
*
- * Before unbundling, this method will call verify_bundle() with the
- * given 'flags'.
+ * Before unbundling, this method will call verify_bundle() with 'flags'
+ * provided in 'opts'.
*/
int unbundle(struct repository *r, struct bundle_header *header,
int bundle_fd, struct strvec *extra_index_pack_args,
- enum verify_bundle_flags flags);
+ struct unbundle_opts *opts);
int list_bundle_refs(struct bundle_header *header,
int argc, const char **argv);
diff --git a/cache-tree.c b/cache-tree.c
index c595e86120..bcbcad3d61 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/chunk-format.c b/chunk-format.c
index 2dde24e6a3..51b5a2c959 100644
--- a/chunk-format.c
+++ b/chunk-format.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "chunk-format.h"
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 126e570eb4..d1cb9fa878 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -29,37 +29,39 @@ alpine-*)
apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty >/dev/null
;;
-fedora-*)
+fedora-*|almalinux-*)
dnf -yq update >/dev/null &&
dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
;;
-ubuntu-*|ubuntu32-*)
+ubuntu-*|ubuntu32-*|debian-*)
# Required so that apt doesn't wait for user input on certain packages.
export DEBIAN_FRONTEND=noninteractive
case "$distro" in
ubuntu-*)
SVN='libsvn-perl subversion'
+ LANGUAGES='language-pack-is'
;;
- *)
+ ubuntu32-*)
SVN=
+ LANGUAGES='language-pack-is'
+ ;;
+ *)
+ SVN='libsvn-perl subversion'
+ LANGUAGES='locales-all'
;;
esac
sudo apt-get -q update
sudo apt-get -q -y install \
- language-pack-is apache2 cvs cvsps git gnupg $SVN \
+ $LANGUAGES apache2 cvs cvsps git gnupg $SVN \
make libssl-dev libcurl4-openssl-dev libexpat-dev wget sudo default-jre \
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \
libemail-valid-perl libio-pty-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \
+ libpcre2-dev meson ninja-build pkg-config \
${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE
case "$distro" in
- ubuntu-16.04)
- # Does not support JGit, but we also don't really care about
- # the others. We rather care whether Git still compiles and
- # runs fine overall.
- ;;
ubuntu-*)
mkdir --parents "$CUSTOM_PATH"
@@ -89,6 +91,12 @@ macos-*)
sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
rm helix-core-server.tgz
+ case "$jobname" in
+ osx-meson)
+ brew install meson ninja pcre2
+ ;;
+ esac
+
if test -n "$CC_PACKAGE"
then
BREW_PACKAGE=${CC_PACKAGE/-/@}
diff --git a/ci/lib.sh b/ci/lib.sh
index 930f98d722..8885ee3c3f 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -18,7 +18,8 @@ elif test true = "$GITLAB_CI"
then
begin_group () {
need_to_end_group=t
- printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n"
+ printf '\e[0Ksection_start:%s:%s[collapsed=true]\r\e[0K%s\n' \
+ "$(date +%s)" "$(echo "$1" | tr ' ' _)" "$1"
trap "end_group '$1'" EXIT
set -x
}
@@ -27,7 +28,8 @@ then
test -n "$need_to_end_group" || return 0
set +x
need_to_end_group=
- printf "\e[0Ksection_end:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K\n"
+ printf '\e[0Ksection_end:%s:%s\r\e[0K\n' \
+ "$(date +%s)" "$(echo "$1" | tr ' ' _)"
trap - EXIT
}
else
@@ -55,8 +57,7 @@ group () {
return $res
}
-begin_group "CI setup"
-trap "end_group 'CI setup'" EXIT
+begin_group "CI setup via $(basename $0)"
# Set 'exit on error' for all CI scripts to let the caller know that
# something went wrong.
@@ -180,9 +181,9 @@ handle_failed_tests () {
}
create_failed_test_artifacts () {
- mkdir -p t/failed-test-artifacts
+ mkdir -p "${TEST_OUTPUT_DIRECTORY:-t}"/failed-test-artifacts
- for test_exit in t/test-results/*.exit
+ for test_exit in "${TEST_OUTPUT_DIRECTORY:-t}"/test-results/*.exit
do
test 0 != "$(cat "$test_exit")" || continue
@@ -191,11 +192,11 @@ create_failed_test_artifacts () {
printf "\\e[33m\\e[1m=== Failed test: ${test_name} ===\\e[m\\n"
echo "The full logs are in the 'print test failures' step below."
echo "See also the 'failed-tests-*' artifacts attached to this run."
- cat "t/test-results/$test_name.markup"
+ cat "${TEST_OUTPUT_DIRECTORY:-t}/test-results/$test_name.markup"
- trash_dir="t/trash directory.$test_name"
- cp "t/test-results/$test_name.out" t/failed-test-artifacts/
- tar czf t/failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
+ trash_dir="${TEST_OUTPUT_DIRECTORY:-t}/trash directory.$test_name"
+ cp "${TEST_OUTPUT_DIRECTORY:-t}/test-results/$test_name.out" "${TEST_OUTPUT_DIRECTORY:-t}"/failed-test-artifacts/
+ tar czf "${TEST_OUTPUT_DIRECTORY:-t}/failed-test-artifacts/$test_name.trash.tar.gz" "$trash_dir"
done
}
@@ -236,7 +237,7 @@ then
CC="${CC_PACKAGE:-${CC:-gcc}}"
DONT_SKIP_TAGS=t
handle_failed_tests () {
- echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
+ echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:-t}/failed-test-artifacts" >>$GITHUB_ENV
create_failed_test_artifacts
return 1
}
@@ -394,5 +395,5 @@ esac
MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"
-end_group "CI setup"
+end_group "CI setup via $(basename $0)"
set -x
diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
index b1f80aeac3..655687dd82 100755
--- a/ci/print-test-failures.sh
+++ b/ci/print-test-failures.sh
@@ -46,7 +46,7 @@ do
;;
github-actions)
mkdir -p failed-test-artifacts
- echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
+ echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV
cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
continue
diff --git a/ci/run-build-and-minimal-fuzzers.sh b/ci/run-build-and-minimal-fuzzers.sh
index af8065f349..e7b97952e7 100755
--- a/ci/run-build-and-minimal-fuzzers.sh
+++ b/ci/run-build-and-minimal-fuzzers.sh
@@ -13,7 +13,18 @@ group "Build fuzzers" make \
LIB_FUZZING_ENGINE="-fsanitize=fuzzer,address" \
fuzz-all
-for fuzzer in commit-graph config date pack-headers pack-idx ; do
+fuzzers="
+commit-graph
+config
+credential-from-url-gently
+date
+pack-headers
+pack-idx
+parse-attr-line
+url-decode-mem
+"
+
+for fuzzer in $fuzzers; do
begin_group "fuzz-$fuzzer"
./oss-fuzz/fuzz-$fuzzer -verbosity=0 -runs=1 || exit 1
end_group "fuzz-$fuzzer"
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 2e28d02b20..76667a1277 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -17,6 +17,7 @@ linux-gcc)
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
;;
linux-TEST-vars)
+ export OPENSSL_SHA1_UNSAFE=YesPlease
export GIT_TEST_SPLIT_INDEX=yes
export GIT_TEST_MERGE_ALGORITHM=recursive
export GIT_TEST_FULL_IN_PACK_ARRAY=true
@@ -48,12 +49,29 @@ pedantic)
;;
esac
-group Build make
-if test -n "$run_tests"
-then
- group "Run tests" make test ||
- handle_failed_tests
-fi
-check_unignored_build_artifacts
+case "$jobname" in
+*-meson)
+ group "Configure" meson setup build . \
+ --warnlevel 2 --werror \
+ --wrap-mode nofallback
+ group "Build" meson compile -C build --
+ if test -n "$run_tests"
+ then
+ group "Run tests" meson test -C build --print-errorlogs --test-args="$GIT_TEST_OPTS" || (
+ ./t/aggregate-results.sh "${TEST_OUTPUT_DIRECTORY:-t}/test-results"
+ handle_failed_tests
+ )
+ fi
+ ;;
+*)
+ group Build make
+ if test -n "$run_tests"
+ then
+ group "Run tests" make test ||
+ handle_failed_tests
+ fi
+ ;;
+esac
+check_unignored_build_artifacts
save_good_tree
diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh
index 02b3af3941..6c018b673e 100755
--- a/ci/test-documentation.sh
+++ b/ci/test-documentation.sh
@@ -6,7 +6,7 @@
. ${0%/*}/lib.sh
filter_log () {
- sed -e '/^GIT_VERSION = /d' \
+ sed -e '/^GIT_VERSION=/d' \
-e "/constant Gem::ConfigMap is deprecated/d" \
-e '/^ \* new asciidoc flags$/d' \
-e '/stripped namespace before processing/d' \
diff --git a/color.c b/color.c
index 227a5ab2f4..7df8862c71 100644
--- a/color.c
+++ b/color.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "color.h"
diff --git a/column.c b/column.c
index 50bbccc92e..93fae316b4 100644
--- a/column.c
+++ b/column.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "column.h"
diff --git a/combine-diff.c b/combine-diff.c
index 33d0ed7097..641bc92dbd 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "object-store-ll.h"
diff --git a/commit-graph.c b/commit-graph.c
index 5bd89c0acd..2a2999a6b8 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -1533,6 +1534,7 @@ static void close_reachable(struct write_commit_graph_context *ctx)
if (ctx->report_progress)
ctx->progress = start_delayed_progress(
+ the_repository,
_("Loading known commits in commit graph"),
ctx->oids.nr);
for (i = 0; i < ctx->oids.nr; i++) {
@@ -1550,6 +1552,7 @@ static void close_reachable(struct write_commit_graph_context *ctx)
*/
if (ctx->report_progress)
ctx->progress = start_delayed_progress(
+ the_repository,
_("Expanding reachable commits in commit graph"),
0);
for (i = 0; i < ctx->oids.nr; i++) {
@@ -1570,6 +1573,7 @@ static void close_reachable(struct write_commit_graph_context *ctx)
if (ctx->report_progress)
ctx->progress = start_delayed_progress(
+ the_repository,
_("Clearing commit marks in commit graph"),
ctx->oids.nr);
for (i = 0; i < ctx->oids.nr; i++) {
@@ -1687,6 +1691,7 @@ static void compute_topological_levels(struct write_commit_graph_context *ctx)
if (ctx->report_progress)
info.progress = ctx->progress
= start_delayed_progress(
+ the_repository,
_("Computing commit graph topological levels"),
ctx->commits.nr);
@@ -1721,6 +1726,7 @@ static void compute_generation_numbers(struct write_commit_graph_context *ctx)
if (ctx->report_progress)
info.progress = ctx->progress
= start_delayed_progress(
+ the_repository,
_("Computing commit graph generation numbers"),
ctx->commits.nr);
@@ -1797,6 +1803,7 @@ static void compute_bloom_filters(struct write_commit_graph_context *ctx)
if (ctx->report_progress)
progress = start_delayed_progress(
+ the_repository,
_("Computing commit changed paths Bloom filters"),
ctx->commits.nr);
@@ -1876,6 +1883,7 @@ int write_commit_graph_reachable(struct object_directory *odb,
data.commits = &commits;
if (flags & COMMIT_GRAPH_WRITE_PROGRESS)
data.progress = start_delayed_progress(
+ the_repository,
_("Collecting referenced commits"), 0);
refs_for_each_ref(get_main_ref_store(the_repository), add_ref_to_set,
@@ -1907,14 +1915,15 @@ static int fill_oids_from_packs(struct write_commit_graph_context *ctx,
"Finding commits for commit graph in %"PRIuMAX" packs",
pack_indexes->nr),
(uintmax_t)pack_indexes->nr);
- ctx->progress = start_delayed_progress(progress_title.buf, 0);
+ ctx->progress = start_delayed_progress(the_repository,
+ progress_title.buf, 0);
ctx->progress_done = 0;
}
for (i = 0; i < pack_indexes->nr; i++) {
struct packed_git *p;
strbuf_setlen(&packname, dirlen);
strbuf_addstr(&packname, pack_indexes->items[i].string);
- p = add_packed_git(packname.buf, packname.len, 1);
+ p = add_packed_git(ctx->r, packname.buf, packname.len, 1);
if (!p) {
ret = error(_("error adding pack %s"), packname.buf);
goto cleanup;
@@ -1958,9 +1967,10 @@ static void fill_oids_from_all_packs(struct write_commit_graph_context *ctx)
{
if (ctx->report_progress)
ctx->progress = start_delayed_progress(
+ the_repository,
_("Finding commits for commit graph among packed objects"),
ctx->approx_nr_objects);
- for_each_packed_object(add_packed_commits, ctx,
+ for_each_packed_object(ctx->r, add_packed_commits, ctx,
FOR_EACH_OBJECT_PACK_ORDER);
if (ctx->progress_done < ctx->approx_nr_objects)
display_progress(ctx->progress, ctx->approx_nr_objects);
@@ -1976,6 +1986,7 @@ static void copy_oids_to_commits(struct write_commit_graph_context *ctx)
ctx->num_extra_edges = 0;
if (ctx->report_progress)
ctx->progress = start_delayed_progress(
+ the_repository,
_("Finding extra edges in commit graph"),
ctx->oids.nr);
oid_array_sort(&ctx->oids);
@@ -2135,6 +2146,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
get_num_chunks(cf)),
get_num_chunks(cf));
ctx->progress = start_delayed_progress(
+ the_repository,
progress_title.buf,
st_mult(get_num_chunks(cf), ctx->commits.nr));
}
@@ -2347,6 +2359,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
if (ctx->report_progress)
ctx->progress = start_delayed_progress(
+ the_repository,
_("Scanning merged commits"),
ctx->commits.nr);
@@ -2391,7 +2404,8 @@ static void merge_commit_graphs(struct write_commit_graph_context *ctx)
current_graph_number--;
if (ctx->report_progress)
- ctx->progress = start_delayed_progress(_("Merging commit-graph"), 0);
+ ctx->progress = start_delayed_progress(the_repository,
+ _("Merging commit-graph"), 0);
merge_commit_graph(ctx, g);
stop_progress(&ctx->progress);
@@ -2873,7 +2887,8 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW))
total += g->num_commits_in_base;
- progress = start_progress(_("Verifying commits in commit graph"),
+ progress = start_progress(the_repository,
+ _("Verifying commits in commit graph"),
total);
}
diff --git a/commit-reach.c b/commit-reach.c
index c3518aa360..a339e41aa4 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -41,8 +41,7 @@ static int compare_commits_by_gen(const void *_a, const void *_b)
static int queue_has_nonstale(struct prio_queue *queue)
{
- int i;
- for (i = 0; i < queue->nr; i++) {
+ for (size_t i = 0; i < queue->nr; i++) {
struct commit *commit = queue->array[i].data;
if (!(commit->object.flags & STALE))
return 1;
@@ -212,12 +211,13 @@ int get_octopus_merge_bases(struct commit_list *in, struct commit_list **result)
}
static int remove_redundant_no_gen(struct repository *r,
- struct commit **array, int cnt)
+ struct commit **array,
+ size_t cnt, size_t *dedup_cnt)
{
struct commit **work;
unsigned char *redundant;
- int *filled_index;
- int i, j, filled;
+ size_t *filled_index;
+ size_t i, j, filled;
CALLOC_ARRAY(work, cnt);
redundant = xcalloc(cnt, 1);
@@ -267,20 +267,22 @@ static int remove_redundant_no_gen(struct repository *r,
for (i = filled = 0; i < cnt; i++)
if (!redundant[i])
array[filled++] = work[i];
+ *dedup_cnt = filled;
free(work);
free(redundant);
free(filled_index);
- return filled;
+ return 0;
}
static int remove_redundant_with_gen(struct repository *r,
- struct commit **array, int cnt)
+ struct commit **array, size_t cnt,
+ size_t *dedup_cnt)
{
- int i, count_non_stale = 0, count_still_independent = cnt;
+ size_t i, count_non_stale = 0, count_still_independent = cnt;
timestamp_t min_generation = GENERATION_NUMBER_INFINITY;
struct commit **walk_start, **sorted;
size_t walk_start_nr = 0, walk_start_alloc = cnt;
- int min_gen_pos = 0;
+ size_t min_gen_pos = 0;
/*
* Sort the input by generation number, ascending. This allows
@@ -326,12 +328,12 @@ static int remove_redundant_with_gen(struct repository *r,
* terminate early. Otherwise, we will do the same amount of work
* as before.
*/
- for (i = walk_start_nr - 1; i >= 0 && count_still_independent > 1; i--) {
+ for (i = walk_start_nr; i && count_still_independent > 1; i--) {
/* push the STALE bits up to min generation */
struct commit_list *stack = NULL;
- commit_list_insert(walk_start[i], &stack);
- walk_start[i]->object.flags |= STALE;
+ commit_list_insert(walk_start[i - 1], &stack);
+ walk_start[i - 1]->object.flags |= STALE;
while (stack) {
struct commit_list *parents;
@@ -388,10 +390,12 @@ static int remove_redundant_with_gen(struct repository *r,
clear_commit_marks_many(walk_start_nr, walk_start, STALE);
free(walk_start);
- return count_non_stale;
+ *dedup_cnt = count_non_stale;
+ return 0;
}
-static int remove_redundant(struct repository *r, struct commit **array, int cnt)
+static int remove_redundant(struct repository *r, struct commit **array,
+ size_t cnt, size_t *dedup_cnt)
{
/*
* Some commit in the array may be an ancestor of
@@ -401,31 +405,30 @@ static int remove_redundant(struct repository *r, struct commit **array, int cnt
* that number.
*/
if (generation_numbers_enabled(r)) {
- int i;
-
/*
* If we have a single commit with finite generation
* number, then the _with_gen algorithm is preferred.
*/
- for (i = 0; i < cnt; i++) {
+ for (size_t i = 0; i < cnt; i++) {
if (commit_graph_generation(array[i]) < GENERATION_NUMBER_INFINITY)
- return remove_redundant_with_gen(r, array, cnt);
+ return remove_redundant_with_gen(r, array, cnt, dedup_cnt);
}
}
- return remove_redundant_no_gen(r, array, cnt);
+ return remove_redundant_no_gen(r, array, cnt, dedup_cnt);
}
static int get_merge_bases_many_0(struct repository *r,
struct commit *one,
- int n,
+ size_t n,
struct commit **twos,
int cleanup,
struct commit_list **result)
{
struct commit_list *list;
struct commit **rslt;
- int cnt, i;
+ size_t cnt, i;
+ int ret;
if (merge_bases_many(r, one, n, twos, result) < 0)
return -1;
@@ -452,8 +455,8 @@ static int get_merge_bases_many_0(struct repository *r,
clear_commit_marks(one, all_flags);
clear_commit_marks_many(n, twos, all_flags);
- cnt = remove_redundant(r, rslt, cnt);
- if (cnt < 0) {
+ ret = remove_redundant(r, rslt, cnt, &cnt);
+ if (ret < 0) {
free(rslt);
return -1;
}
@@ -465,7 +468,7 @@ static int get_merge_bases_many_0(struct repository *r,
int repo_get_merge_bases_many(struct repository *r,
struct commit *one,
- int n,
+ size_t n,
struct commit **twos,
struct commit_list **result)
{
@@ -474,7 +477,7 @@ int repo_get_merge_bases_many(struct repository *r,
int repo_get_merge_bases_many_dirty(struct repository *r,
struct commit *one,
- int n,
+ size_t n,
struct commit **twos,
struct commit_list **result)
{
@@ -582,7 +585,8 @@ struct commit_list *reduce_heads(struct commit_list *heads)
struct commit_list *p;
struct commit_list *result = NULL, **tail = &result;
struct commit **array;
- int num_head, i;
+ size_t num_head, i;
+ int ret;
if (!heads)
return NULL;
@@ -603,11 +607,13 @@ struct commit_list *reduce_heads(struct commit_list *heads)
p->item->object.flags &= ~STALE;
}
}
- num_head = remove_redundant(the_repository, array, num_head);
- if (num_head < 0) {
+
+ ret = remove_redundant(the_repository, array, num_head, &num_head);
+ if (ret < 0) {
free(array);
return NULL;
}
+
for (i = 0; i < num_head; i++)
tail = &commit_list_insert(array[i], tail)->next;
free(array);
@@ -780,12 +786,12 @@ int commit_contains(struct ref_filter *filter, struct commit *commit,
int can_all_from_reach_with_flag(struct object_array *from,
unsigned int with_flag,
unsigned int assign_flag,
- time_t min_commit_date,
+ timestamp_t min_commit_date,
timestamp_t min_generation)
{
struct commit **list = NULL;
- int i;
- int nr_commits;
+ size_t i;
+ size_t nr_commits;
int result = 1;
ALLOC_ARRAY(list, from->nr);
@@ -883,9 +889,9 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to,
int cutoff_by_min_date)
{
struct object_array from_objs = OBJECT_ARRAY_INIT;
- time_t min_commit_date = cutoff_by_min_date ? from->item->date : 0;
struct commit_list *from_iter = from, *to_iter = to;
int result;
+ timestamp_t min_commit_date = cutoff_by_min_date ? from->item->date : 0;
timestamp_t min_generation = GENERATION_NUMBER_INFINITY;
while (from_iter) {
@@ -937,8 +943,8 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to,
return result;
}
-struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
- struct commit **to, int nr_to,
+struct commit_list *get_reachable_subset(struct commit **from, size_t nr_from,
+ struct commit **to, size_t nr_to,
unsigned int reachable_flag)
{
struct commit **item;
diff --git a/commit-reach.h b/commit-reach.h
index 9a745b7e17..6012402dfc 100644
--- a/commit-reach.h
+++ b/commit-reach.h
@@ -14,12 +14,12 @@ int repo_get_merge_bases(struct repository *r,
struct commit *rev2,
struct commit_list **result);
int repo_get_merge_bases_many(struct repository *r,
- struct commit *one, int n,
+ struct commit *one, size_t n,
struct commit **twos,
struct commit_list **result);
/* To be used only when object flags after this call no longer matter */
int repo_get_merge_bases_many_dirty(struct repository *r,
- struct commit *one, int n,
+ struct commit *one, size_t n,
struct commit **twos,
struct commit_list **result);
@@ -81,7 +81,7 @@ int commit_contains(struct ref_filter *filter, struct commit *commit,
int can_all_from_reach_with_flag(struct object_array *from,
unsigned int with_flag,
unsigned int assign_flag,
- time_t min_commit_date,
+ timestamp_t min_commit_date,
timestamp_t min_generation);
int can_all_from_reach(struct commit_list *from, struct commit_list *to,
int commit_date_cutoff);
@@ -95,8 +95,8 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to,
* This method uses the PARENT1 and PARENT2 flags during its operation,
* so be sure these flags are not set before calling the method.
*/
-struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
- struct commit **to, int nr_to,
+struct commit_list *get_reachable_subset(struct commit **from, size_t nr_from,
+ struct commit **to, size_t nr_to,
unsigned int reachable_flag);
struct ahead_behind_count {
diff --git a/commit.c b/commit.c
index cc03a93036..540660359d 100644
--- a/commit.c
+++ b/commit.c
@@ -276,7 +276,7 @@ static int read_graft_file(struct repository *r, const char *graft_file)
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
- "\"git config advice.graftFileDeprecated false\""));
+ "\"git config set advice.graftFileDeprecated false\""));
while (!strbuf_getwholeline(&buf, fp, '\n')) {
/* The format is just "Commit Parent1 Parent2 ...\n" */
struct commit_graft *graft = read_graft_line(&buf);
@@ -778,11 +778,11 @@ static void clear_commit_marks_1(struct commit_list **plist,
}
}
-void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark)
+void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark)
{
struct commit_list *list = NULL;
- while (nr--) {
+ for (size_t i = 0; i < nr; i++) {
clear_commit_marks_1(&list, *commit, mark);
commit++;
}
@@ -1765,7 +1765,6 @@ int commit_tree_extended(const char *msg, size_t msg_len,
{ &compat_sig, r->compat_hash_algo },
{ &sig, r->hash_algo },
};
- int i;
/*
* We write algorithms in the order they were implemented in
@@ -1779,7 +1778,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,
* We traverse each algorithm in order, and apply the signature
* to each buffer.
*/
- for (i = 0; i < ARRAY_SIZE(bufs); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(bufs); i++) {
if (!bufs[i].algo)
continue;
add_header_signature(&buffer, bufs[i].sig, bufs[i].algo);
diff --git a/commit.h b/commit.h
index 943e3d74b2..70c870dae4 100644
--- a/commit.h
+++ b/commit.h
@@ -210,7 +210,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
struct commit *pop_commit(struct commit_list **stack);
void clear_commit_marks(struct commit *commit, unsigned int mark);
-void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark);
+void clear_commit_marks_many(size_t nr, struct commit **commit, unsigned int mark);
enum rev_sort_order {
diff --git a/compat/bswap.h b/compat/bswap.h
index 512f6f4b99..b34054f2bd 100644
--- a/compat/bswap.h
+++ b/compat/bswap.h
@@ -171,23 +171,23 @@ static inline uint64_t get_be64(const void *ptr)
static inline void put_be32(void *ptr, uint32_t value)
{
unsigned char *p = ptr;
- p[0] = value >> 24;
- p[1] = value >> 16;
- p[2] = value >> 8;
- p[3] = value >> 0;
+ p[0] = (value >> 24) & 0xff;
+ p[1] = (value >> 16) & 0xff;
+ p[2] = (value >> 8) & 0xff;
+ p[3] = (value >> 0) & 0xff;
}
static inline void put_be64(void *ptr, uint64_t value)
{
unsigned char *p = ptr;
- p[0] = value >> 56;
- p[1] = value >> 48;
- p[2] = value >> 40;
- p[3] = value >> 32;
- p[4] = value >> 24;
- p[5] = value >> 16;
- p[6] = value >> 8;
- p[7] = value >> 0;
+ p[0] = (value >> 56) & 0xff;
+ p[1] = (value >> 48) & 0xff;
+ p[2] = (value >> 40) & 0xff;
+ p[3] = (value >> 32) & 0xff;
+ p[4] = (value >> 24) & 0xff;
+ p[5] = (value >> 16) & 0xff;
+ p[6] = (value >> 8) & 0xff;
+ p[7] = (value >> 0) & 0xff;
}
#endif /* COMPAT_BSWAP_H */
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index dfa551459d..43c3a915a0 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -208,13 +208,12 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef UNUSED,
const char *slash;
char *resolved = NULL;
struct strbuf tmp = STRBUF_INIT;
- int k;
/*
* Build a list of all filesystem changes into a private/local
* list and without holding any locks.
*/
- for (k = 0; k < num_of_events; k++) {
+ for (size_t k = 0; k < num_of_events; k++) {
/*
* On Mac, we receive an array of absolute paths.
*/
diff --git a/compat/mingw.c b/compat/mingw.c
index 63f36c893b..1d5b211b54 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "../git-compat-util.h"
#include "win32.h"
@@ -2277,7 +2278,7 @@ repeat:
old_handle = CreateFileW(wpold, DELETE,
FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (old_handle == INVALID_HANDLE_VALUE) {
errno = err_win_to_posix(GetLastError());
return -1;
diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index afa6d24584..a2becd16cd 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -18,6 +18,8 @@
You should have received a copy of the GNU General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
/* To bump the minimum Windows version to Windows Vista */
#include "git-compat-util.h"
diff --git a/compat/regex/regex.c b/compat/regex/regex.c
index e6f4a5d177..4b09cc4e14 100644
--- a/compat/regex/regex.c
+++ b/compat/regex/regex.c
@@ -17,6 +17,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#pragma GCC diagnostic ignored "-Wsign-compare"
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
diff --git a/compat/terminal.c b/compat/terminal.c
index d54efa1c5d..584f27bf7e 100644
--- a/compat/terminal.c
+++ b/compat/terminal.c
@@ -259,14 +259,13 @@ static DWORD cmode_in, cmode_out;
void restore_term(void)
{
if (use_stty) {
- int i;
struct child_process cp = CHILD_PROCESS_INIT;
if (stty_restore.nr == 0)
return;
strvec_push(&cp.args, "stty");
- for (i = 0; i < stty_restore.nr; i++)
+ for (size_t i = 0; i < stty_restore.nr; i++)
strvec_push(&cp.args, stty_restore.items[i].string);
run_command(&cp);
string_list_clear(&stty_restore, 0);
diff --git a/compat/win32/headless.c b/compat/win32/headless.c
index 11392a0b9a..a6eb116ddc 100644
--- a/compat/win32/headless.c
+++ b/compat/win32/headless.c
@@ -53,7 +53,8 @@ int WINAPI wWinMain(_In_ HINSTANCE instance,
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;
+ size_t slash = 0;
+ int len;
STARTUPINFO startup_info = {
.cb = sizeof(STARTUPINFO),
@@ -66,7 +67,7 @@ int WINAPI wWinMain(_In_ HINSTANCE instance,
DWORD exit_code;
/* First, determine the full path of argv[0] */
- for (i = 0; _wpgmptr[i]; i++)
+ for (size_t i = 0; _wpgmptr[i]; i++)
if (_wpgmptr[i] == L' ')
needs_quotes = L"\"";
else if (_wpgmptr[i] == L'\\')
@@ -79,16 +80,16 @@ int WINAPI wWinMain(_In_ HINSTANCE instance,
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)
+ len = swprintf_s(git_command_line, size, L"%ls%.*ls\\git.exe%ls",
+ needs_quotes, (int) slash, _wpgmptr, needs_quotes);
+ if (len < 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)
+ len = swprintf_s(git_command_line + len, size - len,
+ L" %ls", command_line);
+ if (len < 0)
return 127;
}
diff --git a/compat/win32mmap.c b/compat/win32mmap.c
index a4ab4cb939..e951934316 100644
--- a/compat/win32mmap.c
+++ b/compat/win32mmap.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "../git-compat-util.h"
void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
diff --git a/compat/winansi.c b/compat/winansi.c
index 1b3f916b9f..ac2ffb7869 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -4,6 +4,8 @@
#undef NOGDI
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "../git-compat-util.h"
#include <wingdi.h>
#include <winreg.h>
diff --git a/config.c b/config.c
index a11bb85da3..50f2d17b39 100644
--- a/config.c
+++ b/config.c
@@ -7,6 +7,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -1493,33 +1494,11 @@ static int git_default_core_config(const char *var, const char *value,
return 0;
}
- if (!strcmp(var, "core.packedgitwindowsize")) {
- int pgsz_x2 = getpagesize() * 2;
- 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;
- if (packed_git_window_size < 1)
- packed_git_window_size = 1;
- packed_git_window_size *= pgsz_x2;
- return 0;
- }
-
if (!strcmp(var, "core.bigfilethreshold")) {
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, ctx->kvi);
- return 0;
- }
-
- if (!strcmp(var, "core.deltabasecachelimit")) {
- delta_base_cache_limit = git_config_ulong(var, value, ctx->kvi);
- return 0;
- }
-
if (!strcmp(var, "core.autocrlf")) {
if (value && !strcasecmp(value, "input")) {
auto_crlf = AUTO_CRLF_INPUT;
diff --git a/config.mak.dev b/config.mak.dev
index 8eca7fa228..0fd8cc4d35 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -53,7 +53,6 @@ ifeq ($(filter extra-all,$(DEVOPTS)),)
# These are disabled because we have these all over the place.
DEVELOPER_CFLAGS += -Wno-empty-body
DEVELOPER_CFLAGS += -Wno-missing-field-initializers
-DEVELOPER_CFLAGS += -Wno-sign-compare
endif
endif
diff --git a/config.mak.uname b/config.mak.uname
index d5112168a4..b12d4e168a 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -819,10 +819,6 @@ vcxproj:
sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \
bin-wrappers/git-{receive-pack,upload-archive}
git add -f $(test_bindir_programs)
- # remote-ext is a builtin, but invoked as if it were external
- sed 's|receive-pack|remote-ext|g' \
- <bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext
- git add -f bin-wrappers/git-remote-ext
# Add templates
$(MAKE) -C templates
diff --git a/configure.ac b/configure.ac
index d1a96da14e..5923edc44a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,7 +142,7 @@ fi
## Configure body starts here.
AC_PREREQ(2.59)
-AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
+AC_INIT([git], [@GIT_VERSION@], [git@vger.kernel.org])
AC_CONFIG_SRCDIR([git.c])
diff --git a/connect.c b/connect.c
index 58f53d8dcb..91f3990014 100644
--- a/connect.c
+++ b/connect.c
@@ -76,7 +76,7 @@ static NORETURN void die_initial_contact(int unexpected)
/* Checks if the server supports the capability 'c' */
int server_supports_v2(const char *c)
{
- int i;
+ size_t i;
for (i = 0; i < server_capabilities_v2.nr; i++) {
const char *out;
@@ -95,7 +95,7 @@ void ensure_server_supports_v2(const char *c)
int server_feature_v2(const char *c, const char **v)
{
- int i;
+ size_t i;
for (i = 0; i < server_capabilities_v2.nr; i++) {
const char *out;
@@ -111,7 +111,7 @@ int server_feature_v2(const char *c, const char **v)
int server_supports_feature(const char *c, const char *feature,
int die_on_error)
{
- int i;
+ size_t i;
for (i = 0; i < server_capabilities_v2.nr; i++) {
const char *out;
@@ -231,12 +231,12 @@ static void annotate_refs_with_symref_info(struct ref *ref)
string_list_clear(&symref, 0);
}
-static void process_capabilities(struct packet_reader *reader, int *linelen)
+static void process_capabilities(struct packet_reader *reader, size_t *linelen)
{
const char *feat_val;
size_t feat_len;
const char *line = reader->line;
- int nul_location = strlen(line);
+ size_t nul_location = strlen(line);
if (nul_location == *linelen)
return;
server_capabilities_v1 = xstrdup(line + nul_location + 1);
@@ -270,14 +270,14 @@ static int process_dummy_ref(const struct packet_reader *reader)
!strcmp(name, "capabilities^{}");
}
-static void check_no_capabilities(const char *line, int len)
+static void check_no_capabilities(const char *line, size_t len)
{
if (strlen(line) != len)
warning(_("ignoring capabilities after first line '%s'"),
line + strlen(line));
}
-static int process_ref(const struct packet_reader *reader, int len,
+static int process_ref(const struct packet_reader *reader, size_t len,
struct ref ***list, unsigned int flags,
struct oid_array *extra_have)
{
@@ -305,7 +305,7 @@ static int process_ref(const struct packet_reader *reader, int len,
return 1;
}
-static int process_shallow(const struct packet_reader *reader, int len,
+static int process_shallow(const struct packet_reader *reader, size_t len,
struct oid_array *shallow_points)
{
const char *line = reader->line;
@@ -340,7 +340,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,
struct oid_array *shallow_points)
{
struct ref **orig_list = list;
- int len = 0;
+ size_t len = 0;
enum get_remote_heads_state state = EXPECTING_FIRST_REF;
*list = NULL;
@@ -393,7 +393,7 @@ static int process_ref_v2(struct packet_reader *reader, struct ref ***list,
const char **unborn_head_target)
{
int ret = 1;
- int i = 0;
+ size_t i = 0;
struct object_id old_oid;
struct ref *ref;
struct string_list line_sections = STRING_LIST_INIT_DUP;
@@ -551,7 +551,7 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
const struct string_list *server_options,
int stateless_rpc)
{
- int i;
+ size_t i;
struct strvec *ref_prefixes = transport_options ?
&transport_options->ref_prefixes : NULL;
const char **unborn_head_target = transport_options ?
diff --git a/connected.c b/connected.c
index a9e2e13995..3099da84f3 100644
--- a/connected.c
+++ b/connected.c
@@ -54,7 +54,8 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
strbuf_add(&idx_file, transport->pack_lockfiles.items[0].string,
base_len);
strbuf_addstr(&idx_file, ".idx");
- new_pack = add_packed_git(idx_file.buf, idx_file.len, 1);
+ new_pack = add_packed_git(the_repository, idx_file.buf,
+ idx_file.len, 1);
strbuf_release(&idx_file);
}
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 8c71f5a1d0..10dc54fdcb 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -83,23 +83,12 @@ if(NOT SH_EXE)
"On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/")
endif()
-#Create GIT-VERSION-FILE using GIT-VERSION-GEN
-if(NOT EXISTS ${CMAKE_SOURCE_DIR}/GIT-VERSION-FILE)
- message("Generating GIT-VERSION-FILE")
- execute_process(COMMAND ${SH_EXE} ${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-endif()
-
-#Parse GIT-VERSION-FILE to get the version
-file(STRINGS ${CMAKE_SOURCE_DIR}/GIT-VERSION-FILE git_version REGEX "GIT_VERSION = (.*)")
-string(REPLACE "GIT_VERSION = " "" git_version ${git_version})
-string(FIND ${git_version} "GIT" location)
-if(location EQUAL -1)
- string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*" git_version ${git_version})
-else()
- string(REGEX MATCH "[0-9]*\\.[0-9]*" git_version ${git_version})
- string(APPEND git_version ".0") #for building from a snapshot
-endif()
+message("Generating Git version")
+execute_process(COMMAND ${SH_EXE} "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_SOURCE_DIR}/contrib/buildsystems/git-version.in"
+ "${CMAKE_BINARY_DIR}/git-version")
+file(STRINGS "${CMAKE_BINARY_DIR}/git-version" git_version)
project(git
VERSION ${git_version}
@@ -110,8 +99,8 @@ project(git
#TODO Enable NLS on windows natively
#macros for parsing the Makefile for sources and scripts
-macro(parse_makefile_for_sources list_var regex)
- file(STRINGS ${CMAKE_SOURCE_DIR}/Makefile ${list_var} REGEX "^${regex} \\+=(.*)")
+macro(parse_makefile_for_sources list_var makefile regex)
+ file(STRINGS ${makefile} ${list_var} REGEX "^${regex} \\+=(.*)")
string(REPLACE "${regex} +=" "" ${list_var} ${${list_var}})
string(REPLACE "$(COMPAT_OBJS)" "" ${list_var} ${${list_var}}) #remove "$(COMPAT_OBJS)" This is only for libgit.
string(STRIP ${${list_var}} ${list_var}) #remove trailing/leading whitespaces
@@ -240,10 +229,7 @@ add_compile_definitions(PAGER_ENV="LESS=FRX LV=-c"
GIT_HTML_PATH="share/doc/git-doc"
DEFAULT_HELP_FORMAT="html"
DEFAULT_GIT_TEMPLATE_DIR="share/git-core/templates"
- GIT_VERSION="${PROJECT_VERSION}.GIT"
- GIT_USER_AGENT="git/${PROJECT_VERSION}.GIT"
- BINDIR="bin"
- GIT_BUILT_FROM_COMMIT="")
+ BINDIR="bin")
if(WIN32)
set(FALLBACK_RUNTIME_PREFIX /mingw64)
@@ -652,60 +638,79 @@ set(EXCLUSION_PROGS_CACHE ${EXCLUSION_PROGS} CACHE STRING "Programs not built" F
if(NOT EXISTS ${CMAKE_BINARY_DIR}/command-list.h OR NOT EXCLUSION_PROGS_CACHE STREQUAL EXCLUSION_PROGS)
list(REMOVE_ITEM EXCLUSION_PROGS empty)
message("Generating command-list.h")
- execute_process(COMMAND ${SH_EXE} ${CMAKE_SOURCE_DIR}/generate-cmdlist.sh ${EXCLUSION_PROGS} command-list.txt
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_FILE ${CMAKE_BINARY_DIR}/command-list.h)
+ execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-cmdlist.sh"
+ ${EXCLUSION_PROGS}
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_BINARY_DIR}/command-list.h")
endif()
if(NOT EXISTS ${CMAKE_BINARY_DIR}/config-list.h)
message("Generating config-list.h")
- execute_process(COMMAND ${SH_EXE} ${CMAKE_SOURCE_DIR}/generate-configlist.sh
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_FILE ${CMAKE_BINARY_DIR}/config-list.h)
+ execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-configlist.sh"
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_BINARY_DIR}/config-list.h")
endif()
if(NOT EXISTS ${CMAKE_BINARY_DIR}/hook-list.h)
message("Generating hook-list.h")
- execute_process(COMMAND ${SH_EXE} ${CMAKE_SOURCE_DIR}/generate-hooklist.sh
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_FILE ${CMAKE_BINARY_DIR}/hook-list.h)
+ execute_process(COMMAND "${SH_EXE}" ${CMAKE_SOURCE_DIR}/generate-hooklist.sh
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_BINARY_DIR}/hook-list.h")
endif()
include_directories(${CMAKE_BINARY_DIR})
#build
#libgit
-parse_makefile_for_sources(libgit_SOURCES "LIB_OBJS")
+parse_makefile_for_sources(libgit_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "LIB_OBJS")
list(TRANSFORM libgit_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
list(TRANSFORM compat_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
+
+add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/version-def.h"
+ COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_SOURCE_DIR}/version-def.h.in"
+ "${CMAKE_BINARY_DIR}/version-def.h"
+ DEPENDS "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}/version-def.h.in"
+ VERBATIM)
+list(APPEND libgit_SOURCES "${CMAKE_BINARY_DIR}/version-def.h")
+
add_library(libgit ${libgit_SOURCES} ${compat_SOURCES})
#libxdiff
-parse_makefile_for_sources(libxdiff_SOURCES "XDIFF_OBJS")
+parse_makefile_for_sources(libxdiff_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "XDIFF_OBJS")
list(TRANSFORM libxdiff_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
add_library(xdiff STATIC ${libxdiff_SOURCES})
#reftable
-parse_makefile_for_sources(reftable_SOURCES "REFTABLE_OBJS")
+parse_makefile_for_sources(reftable_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "REFTABLE_OBJS")
list(TRANSFORM reftable_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
add_library(reftable STATIC ${reftable_SOURCES})
if(WIN32)
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git.rc
+ COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_SOURCE_DIR}/git.rc.in"
+ "${CMAKE_BINARY_DIR}/git.rc"
+ DEPENDS "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}/git.rc.in"
+ VERBATIM)
+
if(NOT MSVC)#use windres when compiling with gcc and clang
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git.res
- COMMAND ${WINDRES_EXE} -O coff -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR}
- -DMICRO=${PROJECT_VERSION_PATCH} -DPATCHLEVEL=0 -DGIT_VERSION="\\\"${PROJECT_VERSION}.GIT\\\""
- -i ${CMAKE_SOURCE_DIR}/git.rc -o ${CMAKE_BINARY_DIR}/git.res
+ COMMAND ${WINDRES_EXE} -O coff -i ${CMAKE_BINARY_DIR}/git.rc -o ${CMAKE_BINARY_DIR}/git.res
+ DEPENDS "${CMAKE_BINARY_DIR}/git.rc"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM)
else()#MSVC use rc
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git.res
- COMMAND ${CMAKE_RC_COMPILER} /d MAJOR=${PROJECT_VERSION_MAJOR} /d MINOR=${PROJECT_VERSION_MINOR}
- /d MICRO=${PROJECT_VERSION_PATCH} /d PATCHLEVEL=0 /d GIT_VERSION="${PROJECT_VERSION}.GIT"
- /fo ${CMAKE_BINARY_DIR}/git.res ${CMAKE_SOURCE_DIR}/git.rc
+ COMMAND ${CMAKE_RC_COMPILER} /fo ${CMAKE_BINARY_DIR}/git.res ${CMAKE_BINARY_DIR}/git.rc
+ DEPENDS "${CMAKE_BINARY_DIR}/git.rc"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM)
endif()
@@ -752,7 +757,7 @@ elseif(UNIX)
endif()
#git
-parse_makefile_for_sources(git_SOURCES "BUILTIN_OBJS")
+parse_makefile_for_sources(git_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "BUILTIN_OBJS")
list(TRANSFORM git_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
add_executable(git ${CMAKE_SOURCE_DIR}/git.c ${git_SOURCES})
@@ -834,70 +839,91 @@ set(git_shell_scripts
${git_sh_scripts} ${git_shlib_scripts} git-instaweb)
foreach(script ${git_shell_scripts})
- file(STRINGS ${CMAKE_SOURCE_DIR}/${script}.sh content NEWLINE_CONSUME)
- string(REPLACE "@SHELL_PATH@" "${SHELL_PATH}" content "${content}")
- string(REPLACE "@@DIFF@@" "diff" content "${content}")
- string(REPLACE "@LOCALEDIR@" "${LOCALEDIR}" content "${content}")
- string(REPLACE "@GITWEBDIR@" "${GITWEBDIR}" content "${content}")
- string(REPLACE "@@NO_CURL@@" "" content "${content}")
- string(REPLACE "@@USE_GETTEXT_SCHEME@@" "" content "${content}")
- string(REPLACE "# @@BROKEN_PATH_FIX@@" "" content "${content}")
- string(REPLACE "@@PERL@@" "${PERL_PATH}" content "${content}")
- string(REPLACE "@@PAGER_ENV@@" "LESS=FRX LV=-c" content "${content}")
- file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content})
+ if ("${script}" IN_LIST git_sh_scripts)
+ string(REPLACE ".sh" "" shell_gen_path "${script}")
+ else()
+ set(shell_gen_path "${script}")
+ endif()
+
+ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${shell_gen_path}"
+ COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-script.sh"
+ "${CMAKE_SOURCE_DIR}/${script}.sh"
+ "${CMAKE_BINARY_DIR}/${shell_gen_path}"
+ "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
+ DEPENDS "${CMAKE_SOURCE_DIR}/generate-script.sh"
+ "${CMAKE_SOURCE_DIR}/${script}.sh"
+ VERBATIM)
+ list(APPEND shell_gen ${CMAKE_BINARY_DIR}/${shell_gen_path})
endforeach()
+add_custom_target(shell-gen ALL DEPENDS ${shell_gen})
#perl scripts
-parse_makefile_for_scripts(git_perl_scripts "SCRIPT_PERL" ".perl")
+parse_makefile_for_scripts(git_perl_scripts "SCRIPT_PERL" "")
+#perl modules
+file(GLOB_RECURSE perl_modules "${CMAKE_SOURCE_DIR}/perl/*.pm")
+list(TRANSFORM perl_modules REPLACE "${CMAKE_SOURCE_DIR}/" "")
#create perl header
file(STRINGS ${CMAKE_SOURCE_DIR}/perl/header_templates/fixed_prefix.template.pl perl_header )
-string(REPLACE "@@PATHSEP@@" ":" perl_header "${perl_header}")
-string(REPLACE "@@INSTLIBDIR@@" "${INSTLIBDIR}" perl_header "${perl_header}")
-
-foreach(script ${git_perl_scripts})
- file(STRINGS ${CMAKE_SOURCE_DIR}/${script}.perl content NEWLINE_CONSUME)
- string(REPLACE "#!/usr/bin/perl" "#!/usr/bin/perl\n${perl_header}\n" content "${content}")
- string(REPLACE "@@GIT_VERSION@@" "${PROJECT_VERSION}" content "${content}")
- file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content})
-endforeach()
-
-#python script
-file(STRINGS ${CMAKE_SOURCE_DIR}/git-p4.py content NEWLINE_CONSUME)
-string(REPLACE "#!/usr/bin/env python" "#!/usr/bin/python" content "${content}")
-file(WRITE ${CMAKE_BINARY_DIR}/git-p4 ${content})
+string(REPLACE "@PATHSEP@" ":" perl_header "${perl_header}")
+string(REPLACE "@INSTLIBDIR@" "${INSTLIBDIR}" perl_header "${perl_header}")
+file(WRITE ${CMAKE_BINARY_DIR}/GIT-PERL-HEADER ${perl_header})
+
+add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
+ COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}"
+ "${CMAKE_SOURCE_DIR}/GIT-VERSION-FILE.in"
+ "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
+ DEPENDS ${SH_EXE} "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
+ "${CMAKE_SOURCE_DIR}/GIT-VERSION-FILE.in"
+ VERBATIM)
-#perl modules
-file(GLOB_RECURSE perl_modules "${CMAKE_SOURCE_DIR}/perl/*.pm")
+foreach(script ${git_perl_scripts} ${perl_modules})
+ string(REPLACE ".perl" "" perl_gen_path "${script}")
-foreach(pm ${perl_modules})
- string(REPLACE "${CMAKE_SOURCE_DIR}/perl/" "" file_path ${pm})
- file(STRINGS ${pm} content NEWLINE_CONSUME)
- string(REPLACE "@@LOCALEDIR@@" "${LOCALEDIR}" content "${content}")
- string(REPLACE "@@NO_PERL_CPAN_FALLBACKS@@" "" content "${content}")
- file(WRITE ${CMAKE_BINARY_DIR}/perl/build/lib/${file_path} ${content})
-#test-lib.sh requires perl/build/lib to be the build directory of perl modules
+ get_filename_component(perl_gen_dir "${perl_gen_path}" DIRECTORY)
+ if(script MATCHES "\.pm$")
+ string(REGEX REPLACE "^perl" "perl/build/lib" perl_gen_dir "${perl_gen_dir}")
+ string(REGEX REPLACE "^perl" "perl/build/lib" perl_gen_path "${perl_gen_path}")
+ endif()
+ file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${perl_gen_dir}")
+
+ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${perl_gen_path}"
+ COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-perl.sh"
+ "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
+ "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
+ "${CMAKE_BINARY_DIR}/GIT-PERL-HEADER"
+ "${CMAKE_SOURCE_DIR}/${script}"
+ "${CMAKE_BINARY_DIR}/${perl_gen_path}"
+ DEPENDS "${CMAKE_SOURCE_DIR}/generate-perl.sh"
+ "${CMAKE_SOURCE_DIR}/${script}"
+ "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
+ "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
+ VERBATIM)
+ list(APPEND perl_gen ${CMAKE_BINARY_DIR}/${perl_gen_path})
endforeach()
+add_custom_target(perl-gen ALL DEPENDS ${perl_gen})
+
+# Python script
+add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/git-p4"
+ COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-python.sh"
+ "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
+ "${CMAKE_SOURCE_DIR}/git-p4.py"
+ "${CMAKE_BINARY_DIR}/git-p4"
+ DEPENDS "${CMAKE_SOURCE_DIR}/generate-python.sh"
+ "${CMAKE_SOURCE_DIR}/git-p4.py"
+ "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
+ VERBATIM)
+add_custom_target(python-gen ALL DEPENDS "${CMAKE_BINARY_DIR}/git-p4")
-
-#templates
-file(GLOB templates "${CMAKE_SOURCE_DIR}/templates/*")
-list(TRANSFORM templates REPLACE "${CMAKE_SOURCE_DIR}/templates/" "")
-list(REMOVE_ITEM templates ".gitignore")
-list(REMOVE_ITEM templates "Makefile")
-list(REMOVE_ITEM templates "blt")# Prevents an error when reconfiguring for in source builds
-
-list(REMOVE_ITEM templates "branches--")
-file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/templates/blt/branches) #create branches
-
+#${CMAKE_SOURCE_DIR}/Makefile templates
+parse_makefile_for_sources(templates ${CMAKE_SOURCE_DIR}/templates/Makefile "TEMPLATES")
+string(REPLACE " " ";" templates ${templates})
#templates have @.*@ replacement so use configure_file instead
foreach(tm ${templates})
- string(REPLACE "--" "/" blt_tm ${tm})
- string(REPLACE "this" "" blt_tm ${blt_tm})# for this--
- configure_file(${CMAKE_SOURCE_DIR}/templates/${tm} ${CMAKE_BINARY_DIR}/templates/blt/${blt_tm} @ONLY)
+ configure_file(${CMAKE_SOURCE_DIR}/templates/${tm} ${CMAKE_BINARY_DIR}/templates/blt/${tm} @ONLY)
endforeach()
-
#translations
if(MSGFMT_EXE)
file(GLOB po_files "${CMAKE_SOURCE_DIR}/po/*.po")
@@ -971,7 +997,7 @@ add_executable(test-fake-ssh ${CMAKE_SOURCE_DIR}/t/helper/test-fake-ssh.c)
target_link_libraries(test-fake-ssh common-main)
#unit-tests
-parse_makefile_for_sources(unit-test_SOURCES "UNIT_TEST_OBJS")
+parse_makefile_for_sources(unit-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "UNIT_TEST_OBJS")
list(TRANSFORM unit-test_SOURCES REPLACE "\\$\\(UNIT_TEST_DIR\\)/" "${CMAKE_SOURCE_DIR}/t/unit-tests/")
add_library(unit-test-lib STATIC ${unit-test_SOURCES})
@@ -1037,7 +1063,7 @@ if(MSVC)
endif()
#test-tool
-parse_makefile_for_sources(test-tool_SOURCES "TEST_BUILTINS_OBJS")
+parse_makefile_for_sources(test-tool_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "TEST_BUILTINS_OBJS")
add_library(test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c)
list(TRANSFORM test-tool_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/t/helper/")
@@ -1056,29 +1082,35 @@ endif()
#wrapper scripts
set(wrapper_scripts
- git git-upload-pack git-receive-pack git-upload-archive git-shell git-remote-ext scalar)
+ git git-upload-pack git-receive-pack git-upload-archive git-shell scalar)
set(wrapper_test_scripts
test-fake-ssh test-tool)
foreach(script ${wrapper_scripts})
- file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
- string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}")
- string(REPLACE "@@PROG@@" "${script}${EXE_EXTENSION}" content "${content}")
+ file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
+ string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
+ string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
+ string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/${script}${EXE_EXTENSION}" content "${content}")
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
endforeach()
foreach(script ${wrapper_test_scripts})
- file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
- string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}")
- string(REPLACE "@@PROG@@" "t/helper/${script}${EXE_EXTENSION}" content "${content}")
+ file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
+ string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
+ string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
+ string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/t/helper/${script}${EXE_EXTENSION}" content "${content}")
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
endforeach()
-file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME)
-string(REPLACE "@@BUILD_DIR@@" "${CMAKE_BINARY_DIR}" content "${content}")
-string(REPLACE "@@PROG@@" "git-cvsserver" content "${content}")
+file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
+string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
+string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
+string(REPLACE "@GIT_TEXTDOMAINDIR@" "${CMAKE_BINARY_DIR}/po/build/locale" content "${content}")
+string(REPLACE "@GITPERLLIB@" "${CMAKE_BINARY_DIR}/perl/build/lib" content "${content}")
+string(REPLACE "@MERGE_TOOLS_DIR@" "${CMAKE_SOURCE_DIR}/mergetools" content "${content}")
+string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/git-cvsserver" content "${content}")
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})
#options for configuring test options
@@ -1125,27 +1157,59 @@ if(NOT PYTHON_TESTS)
set(NO_PYTHON 1)
endif()
-file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "SHELL_PATH='${SHELL_PATH}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TEST_SHELL_PATH='${TEST_SHELL_PATH}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PERL_PATH='${PERL_PATH}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "DIFF='${DIFF}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PYTHON_PATH='${PYTHON_PATH}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TAR='${TAR}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_CURL='${NO_CURL}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_ICONV='${NO_ICONV}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_EXPAT='${NO_EXPAT}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PERL='${NO_PERL}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PTHREADS='${NO_PTHREADS}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_UNIX_SOCKETS='${NO_UNIX_SOCKETS}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PAGER_ENV='${PAGER_ENV}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "X='${EXE_EXTENSION}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_GETTEXT='${NO_GETTEXT}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "RUNTIME_PREFIX='${RUNTIME_PREFIX}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PYTHON='${NO_PYTHON}'\n")
-file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\n")
+file(STRINGS ${CMAKE_SOURCE_DIR}/GIT-BUILD-OPTIONS.in git_build_options NEWLINE_CONSUME)
+string(REPLACE "@BROKEN_PATH_FIX@" "" git_build_options "${git_build_options}")
+string(REPLACE "@DIFF@" "'${DIFF}'" git_build_options "${git_build_options}")
+string(REPLACE "@FSMONITOR_DAEMON_BACKEND@" "win32" git_build_options "${git_build_options}")
+string(REPLACE "@FSMONITOR_OS_SETTINGS@" "win32" git_build_options "${git_build_options}")
+string(REPLACE "@GITWEBDIR@" "'${GITWEBDIR}'" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_INTEROP_MAKE_OPTS@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_PERF_LARGE_REPO@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_PERF_MAKE_COMMAND@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_PERF_MAKE_OPTS@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_PERF_REPEAT_COUNT@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_PERF_REPO@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_CMP@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_CMP_USE_COPIED_CONTEXT@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_GITPERLLIB@" "'${CMAKE_BINARY_DIR}/perl/build/lib'" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_INDEX_VERSION@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_MERGE_TOOLS_DIR@" "'${CMAKE_BINARY_DIR}/mergetools'" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_OPTS@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_PERL_FATAL_WARNINGS@" "" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_POPATH@" "'${CMAKE_BINARY_DIR}/po'" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_TEXTDOMAINDIR@" "'${CMAKE_BINARY_DIR}/po/build/locale'" git_build_options "${git_build_options}")
+string(REPLACE "@GIT_TEST_UTF8_LOCALE@" "" git_build_options "${git_build_options}")
+string(REPLACE "@LOCALEDIR@" "'${LOCALEDIR}'" git_build_options "${git_build_options}")
+string(REPLACE "@NO_CURL@" "${NO_CURL}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_EXPAT@" "${NO_EXPAT}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_GETTEXT@" "${NO_GETTEXT}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_GITWEB@" "1" git_build_options "${git_build_options}")
+string(REPLACE "@NO_ICONV@" "${NO_ICONV}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_PERL@" "${NO_PERL}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_PERL_CPAN_FALLBACKS@" "" git_build_options "${git_build_options}")
+string(REPLACE "@NO_PTHREADS@" "${NO_PTHREADS}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_PYTHON@" "${NO_PYTHON}" git_build_options "${git_build_options}")
+string(REPLACE "@NO_REGEX@" "" git_build_options "${git_build_options}")
+string(REPLACE "@NO_UNIX_SOCKETS@" "${NO_UNIX_SOCKETS}" git_build_options "${git_build_options}")
+string(REPLACE "@PAGER_ENV@" "'${PAGER_ENV}'" git_build_options "${git_build_options}")
+string(REPLACE "@PERL_LOCALEDIR@" "'${LOCALEDIR}'" git_build_options "${git_build_options}")
+string(REPLACE "@PERL_PATH@" "'${PERL_PATH}'" git_build_options "${git_build_options}")
+string(REPLACE "@PYTHON_PATH@" "'${PYTHON_PATH}'" git_build_options "${git_build_options}")
+string(REPLACE "@RUNTIME_PREFIX@" "'${RUNTIME_PREFIX}'" git_build_options "${git_build_options}")
+string(REPLACE "@SANITIZE_ADDRESS@" "" git_build_options "${git_build_options}")
+string(REPLACE "@SANITIZE_LEAK@" "" git_build_options "${git_build_options}")
+string(REPLACE "@SHELL_PATH@" "'${SHELL_PATH}'" git_build_options "${git_build_options}")
+string(REPLACE "@TAR@" "'${TAR}'" git_build_options "${git_build_options}")
+string(REPLACE "@TEST_OUTPUT_DIRECTORY@" "" git_build_options "${git_build_options}")
+string(REPLACE "@TEST_SHELL_PATH@" "'${TEST_SHELL_PATH}'" git_build_options "${git_build_options}")
+string(REPLACE "@USE_GETTEXT_SCHEME@" "" git_build_options "${git_build_options}")
+string(REPLACE "@USE_LIBPCRE2@" "" git_build_options "${git_build_options}")
+string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
if(USE_VCPKG)
- file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
+ string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
endif()
+file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS ${git_build_options})
#Make the tests work when building out of the source tree
get_filename_component(CACHE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../CMakeCache.txt ABSOLUTE)
diff --git a/contrib/buildsystems/git-version.in b/contrib/buildsystems/git-version.in
new file mode 100644
index 0000000000..9750505ae7
--- /dev/null
+++ b/contrib/buildsystems/git-version.in
@@ -0,0 +1 @@
+@GIT_MAJOR_VERSION@.@GIT_MINOR_VERSION@.@GIT_MICRO_VERSION@
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3d4dff3185..413911be3b 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2331,7 +2331,7 @@ _git_mergetool ()
return
;;
--*)
- __gitcomp "--tool= --prompt --no-prompt --gui --no-gui"
+ __gitcomp "--tool= --tool-help --prompt --no-prompt --gui --no-gui"
return
;;
esac
@@ -2737,12 +2737,17 @@ __git_compute_config_vars_all ()
__git_config_vars_all="$(git --no-pager help --config)"
}
+__git_indirect()
+{
+ eval printf '%s' "\"\$$1\""
+}
+
__git_compute_first_level_config_vars_for_section ()
{
local section="$1"
__git_compute_config_vars
local this_section="__git_first_level_config_vars_for_section_${section}"
- test -n "${!this_section}" ||
+ test -n "$(__git_indirect "${this_section}")" ||
printf -v "__git_first_level_config_vars_for_section_${section}" %s \
"$(echo "$__git_config_vars" | awk -F. "/^${section}\.[a-z]/ { print \$2 }")"
}
@@ -2752,7 +2757,7 @@ __git_compute_second_level_config_vars_for_section ()
local section="$1"
__git_compute_config_vars_all
local this_section="__git_second_level_config_vars_for_section_${section}"
- test -n "${!this_section}" ||
+ test -n "$(__git_indirect "${this_section}")" ||
printf -v "__git_second_level_config_vars_for_section_${section}" %s \
"$(echo "$__git_config_vars_all" | awk -F. "/^${section}\.</ { print \$3 }")"
}
@@ -2907,7 +2912,7 @@ __git_complete_config_variable_name ()
local section="${pfx%.*.}"
__git_compute_second_level_config_vars_for_section "${section}"
local this_section="__git_second_level_config_vars_for_section_${section}"
- __gitcomp "${!this_section}" "$pfx" "$cur_" "$sfx"
+ __gitcomp "$(__git_indirect "${this_section}")" "$pfx" "$cur_" "$sfx"
return
;;
branch.*)
@@ -2917,7 +2922,7 @@ __git_complete_config_variable_name ()
__gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
__git_compute_first_level_config_vars_for_section "${section}"
local this_section="__git_first_level_config_vars_for_section_${section}"
- __gitcomp_nl_append "${!this_section}" "$pfx" "$cur_" "${sfx:- }"
+ __gitcomp_nl_append "$(__git_indirect "${this_section}")" "$pfx" "$cur_" "${sfx:- }"
return
;;
pager.*)
@@ -2934,7 +2939,7 @@ __git_complete_config_variable_name ()
__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
__git_compute_first_level_config_vars_for_section "${section}"
local this_section="__git_first_level_config_vars_for_section_${section}"
- __gitcomp_nl_append "${!this_section}" "$pfx" "$cur_" "${sfx:- }"
+ __gitcomp_nl_append "$(__git_indirect "${this_section}")" "$pfx" "$cur_" "${sfx:- }"
return
;;
submodule.*)
@@ -2944,7 +2949,7 @@ __git_complete_config_variable_name ()
__gitcomp_nl "$(__git config -f "$(__git rev-parse --show-toplevel)/.gitmodules" --get-regexp 'submodule.*.path' | awk -F. '{print $2}')" "$pfx" "$cur_" "."
__git_compute_first_level_config_vars_for_section "${section}"
local this_section="__git_first_level_config_vars_for_section_${section}"
- __gitcomp_nl_append "${!this_section}" "$pfx" "$cur_" "${sfx:- }"
+ __gitcomp_nl_append "$(__git_indirect "${this_section}")" "$pfx" "$cur_" "${sfx:- }"
return
;;
*.*)
diff --git a/contrib/completion/meson.build b/contrib/completion/meson.build
new file mode 100644
index 0000000000..3a9ddab594
--- /dev/null
+++ b/contrib/completion/meson.build
@@ -0,0 +1,16 @@
+foreach script : [
+ 'git-completion.bash',
+ 'git-completion.tcsh',
+ 'git-completion.zsh',
+ 'git-prompt.sh'
+]
+ if meson.version().version_compare('>=1.3.0')
+ test_dependencies += fs.copyfile(script)
+ else
+ configure_file(
+ input: script,
+ output: script,
+ copy: true,
+ )
+ endif
+endforeach
diff --git a/contrib/meson.build b/contrib/meson.build
new file mode 100644
index 0000000000..d74b64a518
--- /dev/null
+++ b/contrib/meson.build
@@ -0,0 +1,3 @@
+foreach feature : get_option('contrib')
+ subdir(feature)
+endforeach
diff --git a/contrib/subtree/.gitignore b/contrib/subtree/.gitignore
index 0b9381abca..6deaf177c7 100644
--- a/contrib/subtree/.gitignore
+++ b/contrib/subtree/.gitignore
@@ -1,4 +1,6 @@
*~
+asciidoc.conf
+asciidoctor-extensions.rb
git-subtree
git-subtree.1
git-subtree.html
diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 6fa7496bfd..8fe0bfd401 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -1,6 +1,7 @@
# The default target of this Makefile is...
all::
+-include ../../shared.mak
-include ../../config.mak.autogen
-include ../../config.mak
@@ -13,17 +14,16 @@ htmldir ?= $(prefix)/share/doc/git-doc
../../GIT-VERSION-FILE: FORCE
$(MAKE) -C ../../ GIT-VERSION-FILE
--include ../../GIT-VERSION-FILE
-
# this should be set to a 'standard' bsd-type install program
INSTALL ?= install
RM ?= rm -f
ASCIIDOC = asciidoc
-ASCIIDOC_CONF = -f ../../Documentation/asciidoc.conf
+ASCIIDOC_CONF = -f asciidoc.conf
ASCIIDOC_HTML = xhtml11
ASCIIDOC_DOCBOOK = docbook
ASCIIDOC_EXTRA =
+ASCIIDOC_DEPS = asciidoc.conf
XMLTO = xmlto
XMLTO_EXTRA =
@@ -32,8 +32,9 @@ ASCIIDOC = asciidoctor
ASCIIDOC_CONF =
ASCIIDOC_HTML = xhtml5
ASCIIDOC_DOCBOOK = docbook
-ASCIIDOC_EXTRA += -I../../Documentation -rasciidoctor-extensions
+ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
+ASCIIDOC_DEPS = asciidoctor-extensions.rb
XMLTO_EXTRA += --skip-validation
endif
@@ -82,13 +83,13 @@ install-html: $(GIT_SUBTREE_HTML)
$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $^
-$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
+$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS)
$(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \
- -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
+ $(ASCIIDOC_EXTRA) $<
-$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
+$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS)
$(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
- -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
+ $(ASCIIDOC_EXTRA) $<
$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
cp $< $@
@@ -98,6 +99,12 @@ test: $(GIT_SUBTREE_TEST)
clean:
$(RM) $(GIT_SUBTREE)
+ $(RM) asciidoc.conf asciidoctor-extensions.rb
$(RM) *.xml *.html *.1
+asciidoc.conf: ../../Documentation/asciidoc.conf.in ../../GIT-VERSION-FILE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@)
+asciidoctor-extensions.rb: ../../Documentation/asciidoctor-extensions.rb.in ../../GIT-VERSION-FILE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@)
+
.PHONY: FORCE
diff --git a/contrib/subtree/meson.build b/contrib/subtree/meson.build
new file mode 100644
index 0000000000..a752a188df
--- /dev/null
+++ b/contrib/subtree/meson.build
@@ -0,0 +1,71 @@
+git_subtree = custom_target(
+ input: 'git-subtree.sh',
+ output: 'git-subtree',
+ command: [
+ shell,
+ meson.project_source_root() / 'generate-script.sh',
+ '@INPUT@',
+ '@OUTPUT@',
+ meson.project_build_root() / 'GIT-BUILD-OPTIONS',
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+subtree_test_environment = test_environment
+subtree_test_environment.prepend('PATH', meson.current_build_dir())
+
+test('t7900-subtree', shell,
+ args: [ 't7900-subtree.sh' ],
+ env: subtree_test_environment,
+ workdir: meson.current_source_dir() / 't',
+ depends: test_dependencies + bin_wrappers + [ git_subtree ],
+ timeout: 0,
+)
+
+if get_option('docs').contains('man')
+ subtree_xml = custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_docbook,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: 'git-subtree.txt',
+ output: 'git-subtree.xml',
+ )
+
+ custom_target(
+ command: [
+ xmlto,
+ '-m', '@INPUT@',
+ 'man',
+ subtree_xml,
+ '-o',
+ meson.current_build_dir(),
+ ] + xmlto_extra,
+ input: [
+ '../../Documentation/manpage-normal.xsl',
+ ],
+ output: 'git-subtree.1',
+ install: true,
+ install_dir: get_option('mandir') / 'man1',
+ )
+endif
+
+if get_option('docs').contains('html')
+ custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_html,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: 'git-subtree.txt',
+ output: 'git-subtree.html',
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+endif
diff --git a/convert.c b/convert.c
index c9a31eb4f0..9cc0ca20ca 100644
--- a/convert.c
+++ b/convert.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "advice.h"
diff --git a/credential.c b/credential.c
index 6dea3859ec..2594c0c422 100644
--- a/credential.c
+++ b/credential.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -12,7 +12,7 @@
#include "sigchain.h"
#include "strbuf.h"
#include "urlmatch.h"
-#include "git-compat-util.h"
+#include "environment.h"
#include "trace2.h"
#include "repository.h"
@@ -129,6 +129,10 @@ static int credential_config_callback(const char *var, const char *value,
}
else if (!strcmp(key, "usehttppath"))
c->use_http_path = git_config_bool(var, value);
+ else if (!strcmp(key, "sanitizeprompt"))
+ c->sanitize_prompt = git_config_bool(var, value);
+ else if (!strcmp(key, "protectprotocol"))
+ c->protect_protocol = git_config_bool(var, value);
return 0;
}
@@ -165,7 +169,7 @@ static int match_partial_url(const char *url, void *cb)
return matches;
}
-static void credential_apply_config(struct credential *c)
+static void credential_apply_config(struct repository *r, struct credential *c)
{
char *normalized_url;
struct urlmatch_config config = URLMATCH_CONFIG_INIT;
@@ -190,7 +194,7 @@ static void credential_apply_config(struct credential *c)
credential_format(c, &url);
normalized_url = url_normalize(url.buf, &config.url);
- git_config(urlmatch_config_entry, &config);
+ repo_config(r, urlmatch_config_entry, &config);
string_list_clear(&config.vars, 1);
free(normalized_url);
urlmatch_config_release(&config);
@@ -226,7 +230,8 @@ static void credential_format(struct credential *c, struct strbuf *out)
strbuf_addch(out, '@');
}
if (c->host)
- strbuf_addstr(out, c->host);
+ strbuf_add_percentencode(out, c->host,
+ STRBUF_ENCODE_HOST_AND_PORT);
if (c->path) {
strbuf_addch(out, '/');
strbuf_add_percentencode(out, c->path, 0);
@@ -240,7 +245,10 @@ static char *credential_ask_one(const char *what, struct credential *c,
struct strbuf prompt = STRBUF_INIT;
char *r;
- credential_describe(c, &desc);
+ if (c->sanitize_prompt)
+ credential_format(c, &desc);
+ else
+ credential_describe(c, &desc);
if (desc.len)
strbuf_addf(&prompt, "%s for '%s': ", what, desc.buf);
else
@@ -253,34 +261,34 @@ static char *credential_ask_one(const char *what, struct credential *c,
return xstrdup(r);
}
-static int credential_getpass(struct credential *c)
+static int credential_getpass(struct repository *r, struct credential *c)
{
int interactive;
char *value;
- if (!git_config_get_maybe_bool("credential.interactive", &interactive) &&
+ if (!repo_config_get_maybe_bool(r, "credential.interactive", &interactive) &&
!interactive) {
- trace2_data_intmax("credential", the_repository,
+ trace2_data_intmax("credential", r,
"interactive/skipped", 1);
return -1;
}
- if (!git_config_get_string("credential.interactive", &value)) {
+ if (!repo_config_get_string(r, "credential.interactive", &value)) {
int same = !strcmp(value, "never");
free(value);
if (same) {
- trace2_data_intmax("credential", the_repository,
+ trace2_data_intmax("credential", r,
"interactive/skipped", 1);
return -1;
}
}
- trace2_region_enter("credential", "interactive", the_repository);
+ trace2_region_enter("credential", "interactive", r);
if (!c->username)
c->username = credential_ask_one("Username", c,
PROMPT_ASKPASS|PROMPT_ECHO);
if (!c->password)
c->password = credential_ask_one("Password", c,
PROMPT_ASKPASS);
- trace2_region_leave("credential", "interactive", the_repository);
+ trace2_region_leave("credential", "interactive", r);
return 0;
}
@@ -381,7 +389,8 @@ int credential_read(struct credential *c, FILE *fp,
return 0;
}
-static void credential_write_item(FILE *fp, const char *key, const char *value,
+static void credential_write_item(const struct credential *c,
+ FILE *fp, const char *key, const char *value,
int required)
{
if (!value && required)
@@ -390,6 +399,10 @@ static void credential_write_item(FILE *fp, const char *key, const char *value,
return;
if (strchr(value, '\n'))
die("credential value for %s contains newline", key);
+ if (c->protect_protocol && strchr(value, '\r'))
+ die("credential value for %s contains carriage return\n"
+ "If this is intended, set `credential.protectProtocol=false`",
+ key);
fprintf(fp, "%s=%s\n", key, value);
}
@@ -397,34 +410,34 @@ void credential_write(const struct credential *c, FILE *fp,
enum credential_op_type op_type)
{
if (credential_has_capability(&c->capa_authtype, op_type))
- credential_write_item(fp, "capability[]", "authtype", 0);
+ credential_write_item(c, fp, "capability[]", "authtype", 0);
if (credential_has_capability(&c->capa_state, op_type))
- credential_write_item(fp, "capability[]", "state", 0);
+ credential_write_item(c, fp, "capability[]", "state", 0);
if (credential_has_capability(&c->capa_authtype, op_type)) {
- credential_write_item(fp, "authtype", c->authtype, 0);
- credential_write_item(fp, "credential", c->credential, 0);
+ credential_write_item(c, fp, "authtype", c->authtype, 0);
+ credential_write_item(c, fp, "credential", c->credential, 0);
if (c->ephemeral)
- credential_write_item(fp, "ephemeral", "1", 0);
+ credential_write_item(c, fp, "ephemeral", "1", 0);
}
- credential_write_item(fp, "protocol", c->protocol, 1);
- credential_write_item(fp, "host", c->host, 1);
- 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);
+ credential_write_item(c, fp, "protocol", c->protocol, 1);
+ credential_write_item(c, fp, "host", c->host, 1);
+ credential_write_item(c, fp, "path", c->path, 0);
+ credential_write_item(c, fp, "username", c->username, 0);
+ credential_write_item(c, fp, "password", c->password, 0);
+ credential_write_item(c, 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);
+ credential_write_item(c, fp, "password_expiry_utc", s, 0);
free(s);
}
for (size_t i = 0; i < c->wwwauth_headers.nr; i++)
- credential_write_item(fp, "wwwauth[]", c->wwwauth_headers.v[i], 0);
+ credential_write_item(c, fp, "wwwauth[]", c->wwwauth_headers.v[i], 0);
if (credential_has_capability(&c->capa_state, op_type)) {
if (c->multistage)
- credential_write_item(fp, "continue", "1", 0);
+ credential_write_item(c, fp, "continue", "1", 0);
for (size_t i = 0; i < c->state_headers_to_send.nr; i++)
- credential_write_item(fp, "state[]", c->state_headers_to_send.v[i], 0);
+ credential_write_item(c, fp, "state[]", c->state_headers_to_send.v[i], 0);
}
}
@@ -488,7 +501,8 @@ static int credential_do(struct credential *c, const char *helper,
return r;
}
-void credential_fill(struct credential *c, int all_capabilities)
+void credential_fill(struct repository *r,
+ struct credential *c, int all_capabilities)
{
int i;
@@ -498,7 +512,7 @@ void credential_fill(struct credential *c, int all_capabilities)
credential_next_state(c);
c->multistage = 0;
- credential_apply_config(c);
+ credential_apply_config(r, c);
if (all_capabilities)
credential_set_all_capabilities(c, CREDENTIAL_OP_INITIAL);
@@ -525,12 +539,12 @@ void credential_fill(struct credential *c, int all_capabilities)
c->helpers.items[i].string);
}
- if (credential_getpass(c) ||
+ if (credential_getpass(r, c) ||
(!c->username && !c->password && !c->credential))
die("unable to get password from user");
}
-void credential_approve(struct credential *c)
+void credential_approve(struct repository *r, struct credential *c)
{
int i;
@@ -541,20 +555,20 @@ void credential_approve(struct credential *c)
credential_next_state(c);
- credential_apply_config(c);
+ credential_apply_config(r, c);
for (i = 0; i < c->helpers.nr; i++)
credential_do(c, c->helpers.items[i].string, "store");
c->approved = 1;
}
-void credential_reject(struct credential *c)
+void credential_reject(struct repository *r, struct credential *c)
{
int i;
credential_next_state(c);
- credential_apply_config(c);
+ credential_apply_config(r, c);
for (i = 0; i < c->helpers.nr; i++)
credential_do(c, c->helpers.items[i].string, "erase");
diff --git a/credential.h b/credential.h
index 5f9e6ff2ef..c78b72d110 100644
--- a/credential.h
+++ b/credential.h
@@ -4,6 +4,8 @@
#include "string-list.h"
#include "strvec.h"
+struct repository;
+
/**
* The credentials API provides an abstracted way of gathering
* authentication credentials from the user.
@@ -65,7 +67,7 @@
* // Fill in the username and password fields by contacting
* // helpers and/or asking the user. The function will die if it
* // fails.
- * credential_fill(&c);
+ * credential_fill(repo, &c);
*
* // Otherwise, we have a username and password. Try to use it.
*
@@ -168,7 +170,9 @@ struct credential {
multistage: 1,
quit:1,
use_http_path:1,
- username_from_proto:1;
+ username_from_proto:1,
+ sanitize_prompt:1,
+ protect_protocol:1;
struct credential_capability capa_authtype;
struct credential_capability capa_state;
@@ -195,6 +199,8 @@ struct credential {
.wwwauth_headers = STRVEC_INIT, \
.state_headers = STRVEC_INIT, \
.state_headers_to_send = STRVEC_INIT, \
+ .sanitize_prompt = 1, \
+ .protect_protocol = 1, \
}
/* Initialize a credential structure, setting all fields to empty. */
@@ -218,7 +224,8 @@ void credential_clear(struct credential *);
* If all_capabilities is set, this is an internal user that is prepared
* to deal with all known capabilities, and we should advertise that fact.
*/
-void credential_fill(struct credential *, int all_capabilities);
+void credential_fill(struct repository *, struct credential *,
+ int all_capabilities);
/**
* Inform the credential subsystem that the provided credentials
@@ -227,7 +234,7 @@ void credential_fill(struct credential *, int all_capabilities);
* that they may store the result to be used again. Any errors
* from helpers are ignored.
*/
-void credential_approve(struct credential *);
+void credential_approve(struct repository *, struct credential *);
/**
* Inform the credential subsystem that the provided credentials
@@ -239,7 +246,7 @@ void credential_approve(struct credential *);
* for another call to `credential_fill`). Any errors from helpers
* are ignored.
*/
-void credential_reject(struct credential *);
+void credential_reject(struct repository *, struct credential *);
/**
* Enable all of the supported credential flags in this credential.
diff --git a/csum-file.c b/csum-file.c
index c203ebf11b..5716016e12 100644
--- a/csum-file.c
+++ b/csum-file.c
@@ -23,7 +23,7 @@ static void verify_buffer_or_die(struct hashfile *f,
if (ret < 0)
die_errno("%s: sha1 file read error", f->name);
- if (ret != count)
+ if ((size_t)ret != count)
die("%s: sha1 file truncated", f->name);
if (memcmp(buf, f->check_buffer, count))
die("sha1 file '%s' validation error", f->name);
diff --git a/daemon.c b/daemon.c
index a40e435c63..d1be61fd57 100644
--- a/daemon.c
+++ b/daemon.c
@@ -152,6 +152,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
size_t rlen;
const char *path;
const char *dir;
+ unsigned enter_repo_flags;
dir = directory;
@@ -242,14 +243,15 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
dir = rpath;
}
- path = enter_repo(dir, strict_paths);
+ enter_repo_flags = strict_paths ? ENTER_REPO_STRICT : 0;
+ path = enter_repo(dir, enter_repo_flags);
if (!path && base_path && base_path_relaxed) {
/*
* if we fail and base_path_relaxed is enabled, try without
* prefixing the base path
*/
dir = directory;
- path = enter_repo(dir, strict_paths);
+ path = enter_repo(dir, enter_repo_flags);
}
if (!path) {
@@ -502,8 +504,7 @@ static struct daemon_service daemon_service[] = {
static void enable_service(const char *name, int ena)
{
- int i;
- for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(daemon_service); i++) {
if (!strcmp(daemon_service[i].name, name)) {
daemon_service[i].enabled = ena;
return;
@@ -514,8 +515,7 @@ static void enable_service(const char *name, int ena)
static void make_service_overridable(const char *name, int ena)
{
- int i;
- for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(daemon_service); i++) {
if (!strcmp(daemon_service[i].name, name)) {
daemon_service[i].overridable = ena;
return;
@@ -736,7 +736,7 @@ static void set_keep_alive(int sockfd)
static int execute(void)
{
char *line = packet_buffer;
- int pktlen, len, i;
+ int pktlen, len;
char *addr = getenv("REMOTE_ADDR"), *port = getenv("REMOTE_PORT");
struct hostinfo hi = HOSTINFO_INIT;
struct strvec env = STRVEC_INIT;
@@ -757,7 +757,7 @@ static int execute(void)
if (len != pktlen)
parse_extra_args(&hi, &env, line + len + 1, pktlen - len - 1);
- for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(daemon_service); i++) {
struct daemon_service *s = &(daemon_service[i]);
const char *arg;
@@ -802,8 +802,7 @@ static int addrcmp(const struct sockaddr_storage *s1,
return 0;
}
-static int max_connections = 32;
-
+static unsigned int max_connections = 32;
static unsigned int live_children;
static struct child {
@@ -1107,8 +1106,8 @@ static void socksetup(struct string_list *listen_addr, int listen_port, struct s
if (!listen_addr->nr)
setup_named_sock(NULL, listen_port, socklist);
else {
- int i, socknum;
- for (i = 0; i < listen_addr->nr; i++) {
+ int socknum;
+ for (size_t i = 0; i < listen_addr->nr; i++) {
socknum = setup_named_sock(listen_addr->items[i].string,
listen_port, socklist);
@@ -1122,11 +1121,10 @@ static void socksetup(struct string_list *listen_addr, int listen_port, struct s
static int service_loop(struct socketlist *socklist)
{
struct pollfd *pfd;
- int i;
CALLOC_ARRAY(pfd, socklist->nr);
- for (i = 0; i < socklist->nr; i++) {
+ for (size_t i = 0; i < socklist->nr; i++) {
pfd[i].fd = socklist->list[i];
pfd[i].events = POLLIN;
}
@@ -1134,8 +1132,6 @@ static int service_loop(struct socketlist *socklist)
signal(SIGCHLD, child_handler);
for (;;) {
- int i;
-
check_dead_children();
if (poll(pfd, socklist->nr, -1) < 0) {
@@ -1147,7 +1143,7 @@ static int service_loop(struct socketlist *socklist)
continue;
}
- for (i = 0; i < socklist->nr; i++) {
+ for (size_t i = 0; i < socklist->nr; i++) {
if (pfd[i].revents & POLLIN) {
union {
struct sockaddr sa;
@@ -1319,10 +1315,11 @@ int cmd_main(int argc, const char **argv)
continue;
}
if (skip_prefix(arg, "--max-connections=", &v)) {
- if (strtol_i(v, 10, &max_connections))
+ int parsed_value;
+ if (strtol_i(v, 10, &parsed_value))
die(_("invalid max-connections '%s', expecting an integer"), v);
- if (max_connections < 0)
- max_connections = 0; /* unlimited */
+ /* A negative value indicates unlimited children. */
+ max_connections = parsed_value < 0 ? 0 : parsed_value;
continue;
}
if (!strcmp(arg, "--strict-paths")) {
diff --git a/date.c b/date.c
index bee9fe8f10..a1b26a8dce 100644
--- a/date.c
+++ b/date.c
@@ -4,6 +4,8 @@
* Copyright (C) Linus Torvalds, 2005
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "date.h"
#include "gettext.h"
diff --git a/decorate.c b/decorate.c
index 69aeb142b4..e161e13772 100644
--- a/decorate.c
+++ b/decorate.c
@@ -2,6 +2,9 @@
* decorate.c - decorate a git object with some arbitrary
* data.
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "object.h"
#include "decorate.h"
diff --git a/delta-islands.c b/delta-islands.c
index 8443551259..3aec43fada 100644
--- a/delta-islands.c
+++ b/delta-islands.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "object.h"
@@ -266,7 +267,8 @@ void resolve_tree_islands(struct repository *r,
QSORT(todo, nr, tree_depth_compare);
if (progress)
- progress_state = start_progress(_("Propagating island marks"), nr);
+ progress_state = start_progress(the_repository,
+ _("Propagating island marks"), nr);
for (i = 0; i < nr; i++) {
struct object_entry *ent = todo[i].entry;
diff --git a/diagnose.c b/diagnose.c
index cc2d535b60..bd485effea 100644
--- a/diagnose.c
+++ b/diagnose.c
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "git-compat-util.h"
#include "diagnose.h"
#include "compat/disk.h"
@@ -12,6 +10,7 @@
#include "object-store-ll.h"
#include "packfile.h"
#include "parse-options.h"
+#include "repository.h"
#include "write-or-die.h"
struct archive_dir {
@@ -31,7 +30,6 @@ static struct diagnose_option diagnose_options[] = {
int option_parse_diagnose(const struct option *opt, const char *arg, int unset)
{
- int i;
enum diagnose_mode *diagnose = opt->value;
if (!arg) {
@@ -39,7 +37,7 @@ int option_parse_diagnose(const struct option *opt, const char *arg, int unset)
return 0;
}
- for (i = 0; i < ARRAY_SIZE(diagnose_options); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(diagnose_options); i++) {
if (!strcmp(arg, diagnose_options[i].option_name)) {
*diagnose = diagnose_options[i].mode;
return 0;
@@ -180,13 +178,15 @@ static int add_directory_to_archiver(struct strvec *archiver_args,
return res;
}
-int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
+int create_diagnostics_archive(struct repository *r,
+ struct strbuf *zip_path,
+ enum diagnose_mode mode)
{
struct strvec archiver_args = STRVEC_INIT;
char **argv_copy = NULL;
int stdout_fd = -1, archiver_fd = -1;
struct strbuf buf = STRBUF_INIT;
- int res, i;
+ int res;
struct archive_dir archive_dirs[] = {
{ ".git", 0 },
{ ".git/hooks", 0 },
@@ -219,7 +219,7 @@ int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
strbuf_addstr(&buf, "Collecting diagnostic info\n\n");
get_version_info(&buf, 1);
- strbuf_addf(&buf, "Repository root: %s\n", the_repository->worktree);
+ strbuf_addf(&buf, "Repository root: %s\n", r->worktree);
get_disk_info(&buf);
write_or_die(stdout_fd, buf.buf, buf.len);
strvec_pushf(&archiver_args,
@@ -228,7 +228,7 @@ int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
strbuf_reset(&buf);
strbuf_addstr(&buf, "--add-virtual-file=packs-local.txt:");
- dir_file_stats(the_repository->objects->odb, &buf);
+ dir_file_stats(r->objects->odb, &buf);
foreach_alt_odb(dir_file_stats, &buf);
strvec_push(&archiver_args, buf.buf);
@@ -239,7 +239,7 @@ int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
/* Only include this if explicitly requested */
if (mode == DIAGNOSE_ALL) {
- for (i = 0; i < ARRAY_SIZE(archive_dirs); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(archive_dirs); i++) {
if (add_directory_to_archiver(&archiver_args,
archive_dirs[i].path,
archive_dirs[i].recursive)) {
@@ -251,13 +251,13 @@ int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
}
strvec_pushl(&archiver_args, "--prefix=",
- oid_to_hex(the_hash_algo->empty_tree), "--", NULL);
+ oid_to_hex(r->hash_algo->empty_tree), "--", NULL);
/* `write_archive()` modifies the `argv` passed to it. Let it. */
argv_copy = xmemdupz(archiver_args.v,
sizeof(char *) * archiver_args.nr);
res = write_archive(archiver_args.nr, (const char **)argv_copy, NULL,
- the_repository, NULL, 0);
+ r, NULL, 0);
if (res) {
error(_("failed to write archive"));
goto diagnose_cleanup;
diff --git a/diagnose.h b/diagnose.h
index f525219ab0..f7b38f49f5 100644
--- a/diagnose.h
+++ b/diagnose.h
@@ -4,6 +4,7 @@
#include "strbuf.h"
struct option;
+struct repository;
enum diagnose_mode {
DIAGNOSE_NONE,
@@ -13,6 +14,8 @@ enum diagnose_mode {
int option_parse_diagnose(const struct option *opt, const char *arg, int unset);
-int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode);
+int create_diagnostics_archive(struct repository *r,
+ struct strbuf *zip_path,
+ enum diagnose_mode mode);
#endif /* DIAGNOSE_H */
diff --git a/diff-delta.c b/diff-delta.c
index 77fea08dfb..a4faf73829 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -11,6 +11,8 @@
* published by the Free Software Foundation.
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "delta.h"
diff --git a/diff-lib.c b/diff-lib.c
index 3cf353946f..c6d3bc4d37 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -3,6 +3,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "commit.h"
diff --git a/diff-no-index.c b/diff-no-index.c
index c5fb06e6d1..6f277892d3 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -4,6 +4,8 @@
* Copyright (c) 2008 by Junio C Hamano
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "abspath.h"
#include "color.h"
diff --git a/diff.c b/diff.c
index dceac20d18..0822ae4433 100644
--- a/diff.c
+++ b/diff.c
@@ -3,6 +3,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -4041,7 +4042,8 @@ static int reuse_worktree_file(struct index_state *istate,
* objects however would tend to be slower as they need
* to be individually opened and inflated.
*/
- if (!FAST_WORKING_DIRECTORY && !want_file && has_object_pack(oid))
+ if (!FAST_WORKING_DIRECTORY && !want_file &&
+ has_object_pack(istate->repo, oid))
return 0;
/*
@@ -7384,6 +7386,6 @@ void setup_diff_pager(struct diff_options *opt)
* --exit-code" in hooks and other scripts, we do not do so.
*/
if (!opt->flags.exit_with_status &&
- check_pager_config("diff") != 0)
- setup_pager();
+ check_pager_config(the_repository, "diff") != 0)
+ setup_pager(the_repository);
}
diff --git a/diff.h b/diff.h
index 5c8de79535..6e6007c17b 100644
--- a/diff.h
+++ b/diff.h
@@ -205,9 +205,8 @@ static inline void diff_flags_or(struct diff_flags *a,
{
char *tmp_a = (char *)a;
const char *tmp_b = (const char *)b;
- int i;
- for (i = 0; i < sizeof(struct diff_flags); i++)
+ for (size_t i = 0; i < sizeof(struct diff_flags); i++)
tmp_a[i] |= tmp_b[i];
}
diff --git a/diffcore-order.c b/diffcore-order.c
index 912513d3e6..f91ef22471 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
+
#include "git-compat-util.h"
#include "gettext.h"
#include "diff.h"
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index 43fef8e8ba..a52d569911 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -2,6 +2,9 @@
* Copyright (C) 2005 Junio C Hamano
* Copyright (C) 2010 Google Inc.
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "diff.h"
#include "diffcore.h"
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 1b1c1a6a1f..91b77993c7 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -688,7 +688,6 @@ static void cleanup_dir_rename_info(struct dir_rename_info *info,
struct hashmap_iter iter;
struct strmap_entry *entry;
struct string_list to_remove = STRING_LIST_INIT_NODUP;
- int i;
if (!info->setup)
return;
@@ -734,7 +733,7 @@ static void cleanup_dir_rename_info(struct dir_rename_info *info,
if (strintmap_contains(counts, UNKNOWN_DIR))
strintmap_remove(counts, UNKNOWN_DIR);
}
- for (i = 0; i < to_remove.nr; ++i)
+ for (size_t i = 0; i < to_remove.nr; ++i)
strmap_remove(info->dir_rename_count,
to_remove.items[i].string, 1);
string_list_clear(&to_remove, 0);
@@ -1568,6 +1567,7 @@ void diffcore_rename_extended(struct diff_options *options,
trace2_region_enter("diff", "inexact renames", options->repo);
if (options->show_rename_progress) {
progress = start_delayed_progress(
+ the_repository,
_("Performing inexact rename detection"),
(uint64_t)num_destinations * (uint64_t)num_sources);
}
diff --git a/diffcore-rotate.c b/diffcore-rotate.c
index 73ca20b331..67b591261a 100644
--- a/diffcore-rotate.c
+++ b/diffcore-rotate.c
@@ -2,6 +2,7 @@
* Copyright (C) 2021, Google LLC.
* Based on diffcore-order.c, which is Copyright (C) 2005, Junio C Hamano
*/
+
#include "git-compat-util.h"
#include "gettext.h"
#include "diff.h"
diff --git a/dir.c b/dir.c
index 7f35a3e317..5b2181e589 100644
--- a/dir.c
+++ b/dir.c
@@ -7,6 +7,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
diff --git a/entry.c b/entry.c
index 3143b9996b..81b321e53d 100644
--- a/entry.c
+++ b/entry.c
@@ -188,7 +188,9 @@ int finish_delayed_checkout(struct checkout *state, int show_progress)
dco->state = CE_RETRY;
if (show_progress)
- progress = start_delayed_progress(_("Filtering content"), dco->paths.nr);
+ progress = start_delayed_progress(the_repository,
+ _("Filtering content"),
+ dco->paths.nr);
while (dco->filters.nr > 0) {
for_each_string_list_item(filter, &dco->filters) {
struct string_list available_paths = STRING_LIST_INIT_DUP;
@@ -441,7 +443,7 @@ static int check_path(const char *path, int len, struct stat *st, int skiplen)
static void mark_colliding_entries(const struct checkout *state,
struct cache_entry *ce, struct stat *st)
{
- int i, trust_ino = check_stat;
+ int trust_ino = check_stat;
#if defined(GIT_WINDOWS_NATIVE) || defined(__CYGWIN__)
trust_ino = 0;
@@ -451,7 +453,7 @@ static void mark_colliding_entries(const struct checkout *state,
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(state->istate);
- for (i = 0; i < state->istate->cache_nr; i++) {
+ for (size_t i = 0; i < state->istate->cache_nr; i++) {
struct cache_entry *dup = state->istate->cache[i];
if (dup == ce) {
diff --git a/environment.c b/environment.c
index a2ce998081..8389a27270 100644
--- a/environment.c
+++ b/environment.c
@@ -49,9 +49,6 @@ int fsync_object_files = -1;
int use_fsync = -1;
enum fsync_method fsync_method = FSYNC_METHOD_DEFAULT;
enum fsync_component fsync_components = FSYNC_COMPONENTS_DEFAULT;
-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;
char *editor_program;
char *askpass_program;
diff --git a/environment.h b/environment.h
index 923e12661e..2f43340f0b 100644
--- a/environment.h
+++ b/environment.h
@@ -165,7 +165,6 @@ extern int zlib_compression_level;
extern int pack_compression_level;
extern size_t packed_git_window_size;
extern size_t packed_git_limit;
-extern size_t delta_base_cache_limit;
extern unsigned long big_file_threshold;
extern unsigned long pack_size_limit_cfg;
extern int max_allowed_tree_depth;
diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c
index 8785cbc54a..67f8f588e0 100644
--- a/ewah/ewah_bitmap.c
+++ b/ewah/ewah_bitmap.c
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+
#include "git-compat-util.h"
#include "ewok.h"
#include "ewok_rlw.h"
@@ -255,10 +256,8 @@ void ewah_each_bit(struct ewah_bitmap *self, void (*callback)(size_t, void*), vo
++pointer;
for (k = 0; k < rlw_get_literal_words(word); ++k) {
- int c;
-
/* todo: zero count optimization */
- for (c = 0; c < BITS_IN_EWORD; ++c, ++pos) {
+ for (size_t c = 0; c < BITS_IN_EWORD; ++c, ++pos) {
if ((self->buffer[pointer] & ((eword_t)1 << c)) != 0)
callback(pos, payload);
}
diff --git a/ewah/ewah_io.c b/ewah/ewah_io.c
index 9035ee65ea..da005523b0 100644
--- a/ewah/ewah_io.c
+++ b/ewah/ewah_io.c
@@ -16,6 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "ewok.h"
#include "strbuf.h"
diff --git a/ewah/ewah_rlw.c b/ewah/ewah_rlw.c
index 5093d43e2f..76b4c6c19e 100644
--- a/ewah/ewah_rlw.c
+++ b/ewah/ewah_rlw.c
@@ -16,6 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "ewok.h"
#include "ewok_rlw.h"
diff --git a/fetch-pack.c b/fetch-pack.c
index fe1fb3c1b7..055e8c3643 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "repository.h"
@@ -1857,8 +1858,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,
- const struct config_context *ctx, void *cb)
+int fetch_pack_fsck_config(const char *var, const char *value,
+ struct strbuf *msg_types)
{
const char *msg_id;
@@ -1866,9 +1867,9 @@ static int fetch_pack_config_cb(const char *var, const char *value,
char *path ;
if (git_config_pathname(&path, var, value))
- return 1;
- strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
- fsck_msg_types.len ? ',' : '=', path);
+ return -1;
+ strbuf_addf(msg_types, "%cskiplist=%s",
+ msg_types->len ? ',' : '=', path);
free(path);
return 0;
}
@@ -1877,14 +1878,24 @@ static int fetch_pack_config_cb(const char *var, const char *value,
if (!value)
return config_error_nonbool(var);
if (is_valid_msg_type(msg_id, value))
- strbuf_addf(&fsck_msg_types, "%c%s=%s",
- fsck_msg_types.len ? ',' : '=', msg_id, value);
+ strbuf_addf(msg_types, "%c%s=%s",
+ msg_types->len ? ',' : '=', msg_id, value);
else
warning("Skipping unknown msg id '%s'", msg_id);
return 0;
}
- return git_default_config(var, value, ctx, cb);
+ return 1;
+}
+
+static int fetch_pack_config_cb(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
+{
+ int ret = fetch_pack_fsck_config(var, value, &fsck_msg_types);
+ if (ret > 0)
+ return git_default_config(var, value, ctx, cb);
+
+ return ret;
}
static void fetch_pack_config(void)
diff --git a/fetch-pack.h b/fetch-pack.h
index b5c579cdae..9d3470366f 100644
--- a/fetch-pack.h
+++ b/fetch-pack.h
@@ -106,4 +106,15 @@ int report_unmatched_refs(struct ref **sought, int nr_sought);
*/
int fetch_pack_fsck_objects(void);
+/*
+ * Check if the provided config variable pertains to fetch fsck and if so append
+ * the configuration to the provided strbuf.
+ *
+ * When a fetch fsck config option is successfully processed the function
+ * returns 0. If the provided config option is unrelated to fetch fsck, 1 is
+ * returned. Errors return -1.
+ */
+int fetch_pack_fsck_config(const char *var, const char *value,
+ struct strbuf *msg_types);
+
#endif
diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
index 6acb37b480..5b63c3b088 100644
--- a/fmt-merge-msg.c
+++ b/fmt-merge-msg.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/fsck.c b/fsck.c
index 3756f52459..9fc4c25ffd 100644
--- a/fsck.c
+++ b/fsck.c
@@ -1295,7 +1295,7 @@ static int fsck_blobs(struct oidset *blobs_found, struct oidset *blobs_done,
buf = repo_read_object_file(the_repository, oid, &type, &size);
if (!buf) {
- if (is_promisor_object(oid))
+ if (is_promisor_object(the_repository, oid))
continue;
ret |= report(options,
oid, OBJ_BLOB, msg_missing,
@@ -1353,7 +1353,7 @@ int git_fsck_config(const char *var, const char *value,
struct strbuf sb = STRBUF_INIT;
if (git_config_pathname(&path, var, value))
- return 1;
+ return -1;
strbuf_addf(&sb, "skiplist=%s", path);
free(path);
fsck_set_msg_types(options, sb.buf);
diff --git a/fsmonitor.c b/fsmonitor.c
index 309a2541cb..98b2b476f0 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 205541e0f7..b923a5aab8 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -64,7 +64,7 @@ define_category_names () {
print_command_list () {
echo "static struct cmdname_help command_list[] = {"
- echo "$1" |
+ echo "$2" |
while read cmd rest
do
synopsis=
@@ -76,7 +76,7 @@ print_command_list () {
break
;;
esac
- done <"Documentation/$cmd.txt"
+ done <"$1/Documentation/$cmd.txt"
printf '\t{ "%s", N_("%s"), 0' "$cmd" "$synopsis"
printf " | CAT_%s" $rest
@@ -93,18 +93,28 @@ do
shift
done
-commands="$(command_list "$1")"
-categories="$(category_list "$commands")"
+if test "$#" -ne 2
+then
+ die "USAGE: $0 <SOURCE_DIR> <OUTPUT>"
+fi
+
+SOURCE_DIR="$1"
+OUTPUT="$2"
+
+{
+ commands="$(command_list "$SOURCE_DIR"/command-list.txt)"
+ categories="$(category_list "$commands")"
-echo "/* Automatically generated by generate-cmdlist.sh */
-struct cmdname_help {
- const char *name;
- const char *help;
- uint32_t category;
-};
-"
-define_categories "$categories"
-echo
-define_category_names "$categories"
-echo
-print_command_list "$commands"
+ echo "/* Automatically generated by generate-cmdlist.sh */
+ struct cmdname_help {
+ const char *name;
+ const char *help;
+ uint32_t category;
+ };
+ "
+ define_categories "$categories"
+ echo
+ define_category_names "$categories"
+ echo
+ print_command_list "$SOURCE_DIR" "$commands"
+} >"$OUTPUT"
diff --git a/generate-configlist.sh b/generate-configlist.sh
index 8692fe5cf4..579422619c 100755
--- a/generate-configlist.sh
+++ b/generate-configlist.sh
@@ -1,13 +1,19 @@
#!/bin/sh
-echo "/* Automatically generated by generate-configlist.sh */"
-echo
+SOURCE_DIR="$1"
+OUTPUT="$2"
+
+if test -z "$SOURCE_DIR" || ! test -d "$SOURCE_DIR" || test -z "$OUTPUT"
+then
+ echo >&2 "USAGE: $0 <SOURCE_DIR> <OUTPUT>"
+ exit 1
+fi
print_config_list () {
cat <<EOF
static const char *config_name_list[] = {
EOF
- grep -h '^[a-zA-Z].*\..*::$' Documentation/*config.txt Documentation/config/*.txt |
+ grep -h '^[a-zA-Z].*\..*::$' "$SOURCE_DIR"/Documentation/*config.txt "$SOURCE_DIR"/Documentation/config/*.txt |
sed '/deprecated/d; s/::$//; s/, */\n/g' |
sort |
sed 's/^.*$/ "&",/'
@@ -17,5 +23,9 @@ EOF
EOF
}
-echo
-print_config_list
+{
+ echo "/* Automatically generated by generate-configlist.sh */"
+ echo
+ echo
+ print_config_list
+} >"$OUTPUT"
diff --git a/generate-hooklist.sh b/generate-hooklist.sh
index 2f9f54eb54..e22068c2fa 100755
--- a/generate-hooklist.sh
+++ b/generate-hooklist.sh
@@ -2,6 +2,17 @@
#
# Usage: ./generate-hooklist.sh >hook-list.h
+SOURCE_DIR="$1"
+OUTPUT="$2"
+
+if test -z "$SOURCE_DIR" || ! test -d "$SOURCE_DIR" || test -z "$OUTPUT"
+then
+ echo >&2 "USAGE: $0 <SOURCE_DIR> <OUTPUT>"
+ exit 1
+fi
+
+{
+
cat <<EOF
/* Automatically generated by generate-hooklist.sh */
@@ -11,10 +22,12 @@ EOF
sed -n \
-e '/^~~~~*$/ {x; s/^.*$/ "&",/; p;}' \
-e 'x' \
- <Documentation/githooks.txt |
+ <"$SOURCE_DIR"/Documentation/githooks.txt |
LC_ALL=C sort
cat <<EOF
NULL,
};
EOF
+
+} >"$OUTPUT"
diff --git a/generate-perl.sh b/generate-perl.sh
new file mode 100755
index 0000000000..65f122ebfc
--- /dev/null
+++ b/generate-perl.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 5
+then
+ echo >&2 "USAGE: $0 <GIT_BUILD_OPTIONS> <GIT_VERSION_FILE> <PERL_HEADER> <INPUT> <OUTPUT>"
+ exit 1
+fi
+
+GIT_BUILD_OPTIONS="$1"
+GIT_VERSION_FILE="$2"
+PERL_HEADER="$3"
+INPUT="$4"
+OUTPUT="$5"
+
+. "$GIT_BUILD_OPTIONS"
+. "$GIT_VERSION_FILE"
+
+sed -e '1{' \
+ -e " /^#!.*perl/!b" \
+ -e " s|#!.*perl|#!$PERL_PATH|" \
+ -e " r $PERL_HEADER" \
+ -e ' G' \
+ -e '}' \
+ -e "s|@GIT_VERSION@|$GIT_VERSION|g" \
+ -e "s|@LOCALEDIR@|$PERL_LOCALEDIR|g" \
+ -e "s|@NO_GETTEXT@|$NO_GETTEXT|g" \
+ -e "s|@NO_PERL_CPAN_FALLBACKS@|$NO_PERL_CPAN_FALLBACKS|g" \
+ "$INPUT" >"$OUTPUT"
+
+case "$INPUT" in
+*.perl)
+ chmod a+x "$OUTPUT";;
+*)
+ ;;
+esac
diff --git a/generate-python.sh b/generate-python.sh
new file mode 100755
index 0000000000..31ac115689
--- /dev/null
+++ b/generate-python.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 3
+then
+ echo >&2 "USAGE: $0 <GIT_BUILD_OPTIONS> <INPUT> <OUTPUT>"
+ exit 1
+fi
+
+GIT_BUILD_OPTIONS="$1"
+INPUT="$2"
+OUTPUT="$3"
+
+. "$GIT_BUILD_OPTIONS"
+
+sed -e "1s|#!.*python|#!$PYTHON_PATH|" \
+ "$INPUT" >"$OUTPUT+"
+chmod a+x "$OUTPUT+"
+mv "$OUTPUT+" "$OUTPUT"
diff --git a/generate-script.sh b/generate-script.sh
new file mode 100755
index 0000000000..a149e4f0ba
--- /dev/null
+++ b/generate-script.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 3
+then
+ echo >&2 "USAGE: $0 <INPUT> <OUTPUT> <GIT-BUILD-OPTIONS>"
+ exit 1
+fi
+
+INPUT="$1"
+OUTPUT="$2"
+BUILD_OPTIONS="$3"
+
+. "$BUILD_OPTIONS"
+
+sed -e "1s|#!.*/sh|#!$SHELL_PATH|" \
+ -e "s|@SHELL_PATH@|$SHELL_PATH|" \
+ -e "s|@DIFF@|$DIFF|" \
+ -e "s|@LOCALEDIR@|$LOCALEDIR|g" \
+ -e "s/@USE_GETTEXT_SCHEME@/$USE_GETTEXT_SCHEME/g" \
+ -e "$BROKEN_PATH_FIX" \
+ -e "s|@GITWEBDIR@|$GITWEBDIR|g" \
+ -e "s|@PERL_PATH@|$PERL_PATH|g" \
+ -e "s|@PAGER_ENV@|$PAGER_ENV|g" \
+ "$INPUT" >"$OUTPUT"
+
+case "$(basename "$INPUT")" in
+git-mergetool--lib.sh|git-sh-i18n.sh|git-sh-setup.sh)
+ ;;
+*)
+ chmod a+x "$OUTPUT"
+ ;;
+esac
diff --git a/gettext.c b/gettext.c
index 57facbc21e..8d08a61f84 100644
--- a/gettext.c
+++ b/gettext.c
@@ -2,6 +2,8 @@
* Copyright (c) 2010 Ævar Arnfjörð Bjarmason
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "abspath.h"
#include "environment.h"
diff --git a/git-compat-util.h b/git-compat-util.h
index a06d4f3809..d43dd248c4 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -44,6 +44,16 @@ struct strbuf;
#define GIT_GNUC_PREREQ(maj, min) 0
#endif
+#if defined(__GNUC__) || defined(__clang__)
+# define PRAGMA(pragma) _Pragma(#pragma)
+# define DISABLE_WARNING(warning) PRAGMA(GCC diagnostic ignored #warning)
+#else
+# define DISABLE_WARNING(warning)
+#endif
+
+#ifdef DISABLE_SIGN_COMPARE_WARNINGS
+DISABLE_WARNING(-Wsign-compare)
+#endif
#ifndef FLEX_ARRAY
/*
@@ -691,6 +701,8 @@ int error_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
+void show_usage_if_asked(int ac, const char **av, const char *err);
+
#ifndef NO_OPENSSL
#ifdef APPLE_COMMON_CRYPTO
#include "compat/apple-common-crypto.h"
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index a4ad9a5d2d..a4e1bad33c 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -26,7 +26,7 @@ use File::Path qw/rmtree/;
use File::Basename;
use Getopt::Long qw(:config require_order no_ignore_case);
-my $VERSION = '@@GIT_VERSION@@';
+my $VERSION = '@GIT_VERSION@';
my $log = GITCVS::log->new();
my $cfg;
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index dd0c9a5b7f..d32e47cc09 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -61,9 +61,7 @@ launch_merge_tool () {
export BASE
eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
else
- initialize_merge_tool "$merge_tool"
- # ignore the error from the above --- run_merge_tool
- # will diagnose unusable tool by itself
+ initialize_merge_tool "$merge_tool" || exit 1
run_merge_tool "$merge_tool"
fi
}
@@ -87,9 +85,7 @@ if test -n "$GIT_DIFFTOOL_DIRDIFF"
then
LOCAL="$1"
REMOTE="$2"
- initialize_merge_tool "$merge_tool"
- # ignore the error from the above --- run_merge_tool
- # will diagnose unusable tool by itself
+ initialize_merge_tool "$merge_tool" || exit 1
run_merge_tool "$merge_tool" false
status=$?
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 8fe7538e72..887d6d596c 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1357,7 +1357,6 @@ set current_diff_path {}
set is_3way_diff 0
set is_submodule_diff 0
set is_conflict_diff 0
-set diff_empty_count 0
set last_revert {}
set last_revert_enc {}
@@ -3594,6 +3593,8 @@ $ui_diff tag configure clr1 -font font_diffbold
$ui_diff tag configure clr4 -underline 1
$ui_diff tag conf d_info -foreground blue -font font_diffbold
+$ui_diff tag conf d_rescan -foreground blue -underline 1 -font font_diffbold
+$ui_diff tag bind d_rescan <Button-1> { clear_diff; rescan ui_ready 0 }
$ui_diff tag conf d_cr -elide true
$ui_diff tag conf d_@ -font font_diffbold
diff --git a/git-gui/lib/console.tcl b/git-gui/lib/console.tcl
index bb6b9c889e..fafafb81f1 100644
--- a/git-gui/lib/console.tcl
+++ b/git-gui/lib/console.tcl
@@ -97,7 +97,7 @@ method exec {cmd {after {}}} {
lappend cmd 2>@1
set fd_f [_open_stdout_stderr $cmd]
}
- fconfigure $fd_f -blocking 0 -translation binary
+ fconfigure $fd_f -blocking 0 -translation binary -encoding [encoding system]
fileevent $fd_f readable [cb _read $fd_f $after]
}
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index 871ad488c2..d657bfec05 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -63,28 +63,17 @@ proc force_diff_encoding {enc} {
}
proc handle_empty_diff {} {
- global current_diff_path file_states file_lists
- global diff_empty_count
+ global current_diff_path file_states
+ global ui_diff
set path $current_diff_path
set s $file_states($path)
if {[lindex $s 0] ne {_M} || [has_textconv $path]} return
- # Prevent infinite rescan loops
- incr diff_empty_count
- if {$diff_empty_count > 1} return
-
- info_popup [mc "No differences detected.
-
-%s has no changes.
-
-The modification date of this file was updated by another application, but the content within the file was not changed.
-
-A rescan will be automatically started to find other files which may have the same state." [short_path $path]]
-
- clear_diff
- display_file $path __
- rescan ui_ready 0
+ $ui_diff conf -state normal
+ $ui_diff insert end [mc "* No differences detected; stage the file to de-list it from Unstaged Changes.\n"] d_info
+ $ui_diff insert end [mc "* Click to find other files that may have the same state.\n"] d_rescan
+ $ui_diff conf -state disabled
}
proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} {
@@ -387,7 +376,6 @@ proc read_diff {fd conflict_size cont_info} {
global ui_diff diff_active is_submodule_diff
global is_3way_diff is_conflict_diff current_diff_header
global current_diff_queue
- global diff_empty_count
$ui_diff conf -state normal
while {[gets $fd line] >= 0} {
@@ -559,8 +547,6 @@ proc read_diff {fd conflict_size cont_info} {
if {[$ui_diff index end] eq {2.0}} {
handle_empty_diff
- } else {
- set diff_empty_count 0
}
set callback [lindex $cont_info 1]
diff --git a/git-gui/po/bg.po b/git-gui/po/bg.po
index 5af78f15a8..27b05038e4 100644
--- a/git-gui/po/bg.po
+++ b/git-gui/po/bg.po
@@ -1,15 +1,15 @@
# Bulgarian translation of git-gui po-file.
-# Copyright (C) 2012, 2013, 2014, 2015, 2016 Alexander Shopov <ash@kambanaria.org>.
+# Copyright (C) 2012, 2013, 2014, 2015, 2016, 2024 Alexander Shopov <ash@kambanaria.org>.
# This file is distributed under the same license as the git package.
-# Alexander Shopov <ash@kambanaria.org>, 2012, 2013, 2014, 2015, 2016.
+# Alexander Shopov <ash@kambanaria.org>, 2012, 2013, 2014, 2015, 2016, 2024.
#
#
msgid ""
msgstr ""
"Project-Id-Version: git-gui master\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-10-13 15:16+0300\n"
-"PO-Revision-Date: 2016-10-13 15:16+0300\n"
+"POT-Creation-Date: 2020-02-08 22:54+0100\n"
+"PO-Revision-Date: 2024-12-22 15:44+0100\n"
"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
"Language: bg\n"
@@ -18,33 +18,33 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: git-gui.sh:865
+#: git-gui.sh:847
#, tcl-format
msgid "Invalid font specified in %s:"
msgstr "Указан е неправилен шрифт в „%s“:"
-#: git-gui.sh:919
+#: git-gui.sh:901
msgid "Main Font"
msgstr "Основен шрифт"
-#: git-gui.sh:920
+#: git-gui.sh:902
msgid "Diff/Console Font"
msgstr "Шрифт за разликите/конзолата"
-#: git-gui.sh:935 git-gui.sh:949 git-gui.sh:962 git-gui.sh:1052 git-gui.sh:1071
-#: git-gui.sh:3147
+#: git-gui.sh:917 git-gui.sh:931 git-gui.sh:944 git-gui.sh:1034 git-gui.sh:1053
+#: git-gui.sh:3212
msgid "git-gui: fatal error"
msgstr "git-gui: фатална грешка"
-#: git-gui.sh:936
+#: git-gui.sh:918
msgid "Cannot find git in PATH."
msgstr "Командата git липсва в пътя (PATH)."
-#: git-gui.sh:963
+#: git-gui.sh:945
msgid "Cannot parse Git version string:"
-msgstr "Низът с версията на Git не може да бъде интерпретиран:"
+msgstr "Низът с версията на Git не може да се анализира:"
-#: git-gui.sh:988
+#: git-gui.sh:970
#, tcl-format
msgid ""
"Git version cannot be determined.\n"
@@ -55,7 +55,7 @@ msgid ""
"\n"
"Assume '%s' is version 1.5.0?\n"
msgstr ""
-"Версията на Git не може да бъде определена.\n"
+"Версията на Git не може да се определи.\n"
"\n"
"Версията на „%s“ изглежда, че е „%s“.\n"
"\n"
@@ -63,506 +63,522 @@ msgstr ""
"\n"
"Да се приеме ли, че „%s“ е версия „1.5.0“?\n"
-#: git-gui.sh:1285
+#: git-gui.sh:1267
msgid "Git directory not found:"
msgstr "Директорията на Git не е открита:"
-#: git-gui.sh:1319
+#: git-gui.sh:1301
msgid "Cannot move to top of working directory:"
-msgstr "Не може да се премине към родителската директория."
+msgstr "Не може да се премине към родителската директория."
-#: git-gui.sh:1327
+#: git-gui.sh:1309
msgid "Cannot use bare repository:"
msgstr "Голо хранилище не може да се използва:"
-#: git-gui.sh:1335
+#: git-gui.sh:1317
msgid "No working directory"
msgstr "Работната директория липсва"
-#: git-gui.sh:1507 lib/checkout_op.tcl:306
+#: git-gui.sh:1491 lib/checkout_op.tcl:306
msgid "Refreshing file status..."
msgstr "Обновяване на състоянието на файла…"
-#: git-gui.sh:1567
+#: git-gui.sh:1551
msgid "Scanning for modified files ..."
msgstr "Проверка за променени файлове…"
-#: git-gui.sh:1645
+#: git-gui.sh:1629
msgid "Calling prepare-commit-msg hook..."
msgstr "Куката „prepare-commit-msg“ се изпълнява в момента…"
-#: git-gui.sh:1662
+#: git-gui.sh:1646
msgid "Commit declined by prepare-commit-msg hook."
msgstr "Подаването е отхвърлено от куката „prepare-commit-msg“."
-#: git-gui.sh:1820 lib/browser.tcl:252
+#: git-gui.sh:1804 lib/browser.tcl:252
msgid "Ready."
msgstr "Готово."
-#: git-gui.sh:1984
+#: git-gui.sh:1968
#, tcl-format
msgid ""
"Display limit (gui.maxfilesdisplayed = %s) reached, not showing all %s files."
msgstr ""
-"Достигнат е максималният размер на списъка за извеждане(gui."
-"maxfilesdisplayed = %s), съответно не са показани всички %s файла."
+"Достигнат е максималният размер на списъка за "
+"извеждане(gui.maxfilesdisplayed = %s), съответно не са показани всички %s "
+"файла."
-#: git-gui.sh:2107
+#: git-gui.sh:2091
msgid "Unmodified"
msgstr "Непроменен"
-#: git-gui.sh:2109
+#: git-gui.sh:2093
msgid "Modified, not staged"
msgstr "Променен, но не е в индекса"
-#: git-gui.sh:2110 git-gui.sh:2122
+#: git-gui.sh:2094 git-gui.sh:2106
msgid "Staged for commit"
msgstr "В индекса за подаване"
-#: git-gui.sh:2111 git-gui.sh:2123
+#: git-gui.sh:2095 git-gui.sh:2107
msgid "Portions staged for commit"
msgstr "Части са в индекса за подаване"
-#: git-gui.sh:2112 git-gui.sh:2124
+#: git-gui.sh:2096 git-gui.sh:2108
msgid "Staged for commit, missing"
msgstr "В индекса за подаване, но липсва"
-#: git-gui.sh:2114
+#: git-gui.sh:2098
msgid "File type changed, not staged"
msgstr "Видът на файла е сменен, но не е в индекса"
-#: git-gui.sh:2115 git-gui.sh:2116
+#: git-gui.sh:2099 git-gui.sh:2100
msgid "File type changed, old type staged for commit"
msgstr "Видът на файла е сменен, но новият вид не е в индекса"
-#: git-gui.sh:2117
+#: git-gui.sh:2101
msgid "File type changed, staged"
msgstr "Видът на файла е сменен и е в индекса"
-#: git-gui.sh:2118
+#: git-gui.sh:2102
msgid "File type change staged, modification not staged"
msgstr "Видът на файла е сменен в индекса, но не и съдържанието"
-#: git-gui.sh:2119
+#: git-gui.sh:2103
msgid "File type change staged, file missing"
msgstr "Видът на файла е сменен в индекса, но файлът липсва"
-#: git-gui.sh:2121
+#: git-gui.sh:2105
msgid "Untracked, not staged"
msgstr "Неследен"
-#: git-gui.sh:2126
+#: git-gui.sh:2110
msgid "Missing"
msgstr "Липсващ"
-#: git-gui.sh:2127
+#: git-gui.sh:2111
msgid "Staged for removal"
msgstr "В индекса за изтриване"
-#: git-gui.sh:2128
+#: git-gui.sh:2112
msgid "Staged for removal, still present"
msgstr "В индекса за изтриване, но още го има"
-#: git-gui.sh:2130 git-gui.sh:2131 git-gui.sh:2132 git-gui.sh:2133
-#: git-gui.sh:2134 git-gui.sh:2135
+#: git-gui.sh:2114 git-gui.sh:2115 git-gui.sh:2116 git-gui.sh:2117
+#: git-gui.sh:2118 git-gui.sh:2119
msgid "Requires merge resolution"
msgstr "Изисква коригиране при сливане"
-#: git-gui.sh:2170
-msgid "Starting gitk... please wait..."
-msgstr "Стартиране на „gitk“…, изчакайте…"
-
-#: git-gui.sh:2182
+#: git-gui.sh:2164
msgid "Couldn't find gitk in PATH"
msgstr "Командата „gitk“ липсва в пътищата, определени от променливата PATH."
-#: git-gui.sh:2241
+#: git-gui.sh:2210 git-gui.sh:2245
+#, tcl-format
+msgid "Starting %s... please wait..."
+msgstr "Стартиране на „%s“…, изчакайте…"
+
+#: git-gui.sh:2224
msgid "Couldn't find git gui in PATH"
msgstr ""
"Командата „git gui“ липсва в пътищата, определени от променливата PATH."
-#: git-gui.sh:2676 lib/choose_repository.tcl:41
+#: git-gui.sh:2726 lib/choose_repository.tcl:53
msgid "Repository"
msgstr "Хранилище"
-#: git-gui.sh:2677
+#: git-gui.sh:2727
msgid "Edit"
msgstr "Редактиране"
-#: git-gui.sh:2679 lib/choose_rev.tcl:567
+#: git-gui.sh:2729 lib/choose_rev.tcl:567
msgid "Branch"
msgstr "Клон"
-#: git-gui.sh:2682 lib/choose_rev.tcl:554
+#: git-gui.sh:2732 lib/choose_rev.tcl:554
msgid "Commit@@noun"
msgstr "Подаване"
-#: git-gui.sh:2685 lib/merge.tcl:127 lib/merge.tcl:174
+#: git-gui.sh:2735 lib/merge.tcl:127 lib/merge.tcl:174
msgid "Merge"
msgstr "Сливане"
-#: git-gui.sh:2686 lib/choose_rev.tcl:563
+#: git-gui.sh:2736 lib/choose_rev.tcl:563
msgid "Remote"
msgstr "Отдалечено хранилище"
-#: git-gui.sh:2689
+#: git-gui.sh:2739
msgid "Tools"
msgstr "Команди"
-#: git-gui.sh:2698
+#: git-gui.sh:2748
msgid "Explore Working Copy"
msgstr "Разглеждане на работното копие"
-#: git-gui.sh:2704
+#: git-gui.sh:2763
msgid "Git Bash"
msgstr "Bash за Git"
-#: git-gui.sh:2714
+#: git-gui.sh:2772
msgid "Browse Current Branch's Files"
msgstr "Разглеждане на файловете в текущия клон"
-#: git-gui.sh:2718
+#: git-gui.sh:2776
msgid "Browse Branch Files..."
msgstr "Разглеждане на текущия клон…"
-#: git-gui.sh:2723
+#: git-gui.sh:2781
msgid "Visualize Current Branch's History"
msgstr "Визуализация на историята на текущия клон"
-#: git-gui.sh:2727
+#: git-gui.sh:2785
msgid "Visualize All Branch History"
msgstr "Визуализация на историята на всички клонове"
-#: git-gui.sh:2734
+#: git-gui.sh:2792
#, tcl-format
msgid "Browse %s's Files"
msgstr "Разглеждане на файловете в „%s“"
-#: git-gui.sh:2736
+#: git-gui.sh:2794
#, tcl-format
msgid "Visualize %s's History"
msgstr "Визуализация на историята на „%s“"
-#: git-gui.sh:2741 lib/database.tcl:40
+#: git-gui.sh:2799 lib/database.tcl:40
msgid "Database Statistics"
msgstr "Статистика на базата от данни"
-#: git-gui.sh:2744 lib/database.tcl:33
+#: git-gui.sh:2802 lib/database.tcl:33
msgid "Compress Database"
msgstr "Компресиране на базата от данни"
-#: git-gui.sh:2747
+#: git-gui.sh:2805
msgid "Verify Database"
msgstr "Проверка на базата от данни"
-#: git-gui.sh:2754 git-gui.sh:2758 git-gui.sh:2762
+#: git-gui.sh:2812 git-gui.sh:2816 git-gui.sh:2820
msgid "Create Desktop Icon"
msgstr "Добавяне на икона на работния плот"
-#: git-gui.sh:2770 lib/choose_repository.tcl:193 lib/choose_repository.tcl:201
+#: git-gui.sh:2828 lib/choose_repository.tcl:209 lib/choose_repository.tcl:217
msgid "Quit"
msgstr "Спиране на програмата"
-#: git-gui.sh:2778
+#: git-gui.sh:2836
msgid "Undo"
msgstr "Отмяна"
-#: git-gui.sh:2781
+#: git-gui.sh:2839
msgid "Redo"
msgstr "Повторение"
-#: git-gui.sh:2785 git-gui.sh:3399
+#: git-gui.sh:2843 git-gui.sh:3461
msgid "Cut"
msgstr "Отрязване"
-#: git-gui.sh:2788 git-gui.sh:3402 git-gui.sh:3476 git-gui.sh:3562
+#: git-gui.sh:2846 git-gui.sh:3464 git-gui.sh:3540 git-gui.sh:3633
#: lib/console.tcl:69
msgid "Copy"
msgstr "Копиране"
-#: git-gui.sh:2791 git-gui.sh:3405
+#: git-gui.sh:2849 git-gui.sh:3467
msgid "Paste"
msgstr "Поставяне"
-#: git-gui.sh:2794 git-gui.sh:3408 lib/branch_delete.tcl:28
-#: lib/remote_branch_delete.tcl:39
+#: git-gui.sh:2852 git-gui.sh:3470 lib/remote_branch_delete.tcl:39
+#: lib/branch_delete.tcl:28
msgid "Delete"
msgstr "Изтриване"
-#: git-gui.sh:2798 git-gui.sh:3412 git-gui.sh:3566 lib/console.tcl:71
+#: git-gui.sh:2856 git-gui.sh:3474 git-gui.sh:3637 lib/console.tcl:71
msgid "Select All"
msgstr "Избиране на всичко"
-#: git-gui.sh:2807
+#: git-gui.sh:2865
msgid "Create..."
msgstr "Създаване…"
-#: git-gui.sh:2813
+#: git-gui.sh:2871
msgid "Checkout..."
msgstr "Изтегляне…"
-#: git-gui.sh:2819
+#: git-gui.sh:2877
msgid "Rename..."
msgstr "Преименуване…"
-#: git-gui.sh:2824
+#: git-gui.sh:2882
msgid "Delete..."
msgstr "Изтриване…"
-#: git-gui.sh:2829
+#: git-gui.sh:2887
msgid "Reset..."
msgstr "Отмяна на промените…"
-#: git-gui.sh:2839
+#: git-gui.sh:2897
msgid "Done"
msgstr "Готово"
-#: git-gui.sh:2841
+#: git-gui.sh:2899
msgid "Commit@@verb"
msgstr "Подаване"
-#: git-gui.sh:2850 git-gui.sh:3335
-msgid "New Commit"
-msgstr "Ново подаване"
-
-#: git-gui.sh:2858 git-gui.sh:3342
+#: git-gui.sh:2908 git-gui.sh:3400
msgid "Amend Last Commit"
msgstr "Поправяне на последното подаване"
-#: git-gui.sh:2868 git-gui.sh:3296 lib/remote_branch_delete.tcl:101
+#: git-gui.sh:2918 git-gui.sh:3361 lib/remote_branch_delete.tcl:101
msgid "Rescan"
msgstr "Обновяване"
-#: git-gui.sh:2874
+#: git-gui.sh:2924
msgid "Stage To Commit"
msgstr "Към индекса за подаване"
-#: git-gui.sh:2880
+#: git-gui.sh:2930
msgid "Stage Changed Files To Commit"
msgstr "Всички променени файлове към индекса за подаване"
-#: git-gui.sh:2886
+#: git-gui.sh:2936
msgid "Unstage From Commit"
msgstr "Изваждане от индекса за подаване"
-#: git-gui.sh:2892 lib/index.tcl:442
+#: git-gui.sh:2942 lib/index.tcl:521
msgid "Revert Changes"
msgstr "Връщане на оригинала"
-#: git-gui.sh:2900 git-gui.sh:3613 git-gui.sh:3644
+#: git-gui.sh:2950 git-gui.sh:3700 git-gui.sh:3731
msgid "Show Less Context"
msgstr "По-малко контекст"
-#: git-gui.sh:2904 git-gui.sh:3617 git-gui.sh:3648
+#: git-gui.sh:2954 git-gui.sh:3704 git-gui.sh:3735
msgid "Show More Context"
msgstr "Повече контекст"
-#: git-gui.sh:2911 git-gui.sh:3309 git-gui.sh:3423
+#: git-gui.sh:2961 git-gui.sh:3374 git-gui.sh:3485
msgid "Sign Off"
msgstr "Подписване"
-#: git-gui.sh:2927
+#: git-gui.sh:2977
msgid "Local Merge..."
msgstr "Локално сливане…"
-#: git-gui.sh:2932
+#: git-gui.sh:2982
msgid "Abort Merge..."
msgstr "Преустановяване на сливане…"
-#: git-gui.sh:2944 git-gui.sh:2972
+#: git-gui.sh:2994 git-gui.sh:3022
msgid "Add..."
msgstr "Добавяне…"
-#: git-gui.sh:2948
+#: git-gui.sh:2998
msgid "Push..."
msgstr "Изтласкване…"
-#: git-gui.sh:2952
+#: git-gui.sh:3002
msgid "Delete Branch..."
msgstr "Изтриване на клон…"
-#: git-gui.sh:2962 git-gui.sh:3595
+#: git-gui.sh:3012 git-gui.sh:3666
msgid "Options..."
msgstr "Опции…"
-#: git-gui.sh:2973
+#: git-gui.sh:3023
msgid "Remove..."
msgstr "Премахване…"
-#: git-gui.sh:2982 lib/choose_repository.tcl:55
+#: git-gui.sh:3032 lib/choose_repository.tcl:67
msgid "Help"
msgstr "Помощ"
-#: git-gui.sh:2986 git-gui.sh:2990 lib/about.tcl:14
-#: lib/choose_repository.tcl:49 lib/choose_repository.tcl:58
+#: git-gui.sh:3036 git-gui.sh:3040 lib/choose_repository.tcl:61
+#: lib/choose_repository.tcl:70 lib/about.tcl:14
#, tcl-format
msgid "About %s"
-msgstr "Относно %s"
+msgstr "Относно „%s“"
-#: git-gui.sh:3014
+#: git-gui.sh:3064
msgid "Online Documentation"
msgstr "Документация в Интернет"
-#: git-gui.sh:3017 lib/choose_repository.tcl:52 lib/choose_repository.tcl:61
+#: git-gui.sh:3067 lib/choose_repository.tcl:64 lib/choose_repository.tcl:73
msgid "Show SSH Key"
msgstr "Показване на ключа за SSH"
-#: git-gui.sh:3032 git-gui.sh:3164
+#: git-gui.sh:3097 git-gui.sh:3229
msgid "usage:"
msgstr "употреба:"
-#: git-gui.sh:3036 git-gui.sh:3168
+#: git-gui.sh:3101 git-gui.sh:3233
msgid "Usage"
msgstr "Употреба"
-#: git-gui.sh:3117 lib/blame.tcl:573
+#: git-gui.sh:3182 lib/blame.tcl:575
msgid "Error"
msgstr "Грешка"
-#: git-gui.sh:3148
+#: git-gui.sh:3213
#, tcl-format
msgid "fatal: cannot stat path %s: No such file or directory"
-msgstr ""
-"ФАТАЛНА ГРЕШКА: пътят %s не може да бъде открит: такъв файл или директория "
-"няма"
+msgstr "ФАТАЛНА ГРЕШКА: пътят „%s“ липсва: такъв файл или директория няма"
-#: git-gui.sh:3181
+#: git-gui.sh:3246
msgid "Current Branch:"
msgstr "Текущ клон:"
-#: git-gui.sh:3206
+#: git-gui.sh:3271
msgid "Unstaged Changes"
msgstr "Промени извън индекса"
-#: git-gui.sh:3228
+#: git-gui.sh:3293
msgid "Staged Changes (Will Commit)"
msgstr "Промени в индекса (за подаване)"
-#: git-gui.sh:3302
+#: git-gui.sh:3367
msgid "Stage Changed"
msgstr "Индексът е променен"
-#: git-gui.sh:3321 lib/transport.tcl:137
+#: git-gui.sh:3386 lib/transport.tcl:137
msgid "Push"
msgstr "Изтласкване"
-#: git-gui.sh:3356
+#: git-gui.sh:3413
msgid "Initial Commit Message:"
msgstr "Първоначално съобщение при подаване:"
-#: git-gui.sh:3357
+#: git-gui.sh:3414
msgid "Amended Commit Message:"
msgstr "Поправено съобщение при подаване:"
-#: git-gui.sh:3358
+#: git-gui.sh:3415
msgid "Amended Initial Commit Message:"
msgstr "Поправено първоначално съобщение при подаване:"
-#: git-gui.sh:3359
+#: git-gui.sh:3416
msgid "Amended Merge Commit Message:"
msgstr "Поправено съобщение при подаване със сливане:"
-#: git-gui.sh:3360
+#: git-gui.sh:3417
msgid "Merge Commit Message:"
msgstr "Съобщение при подаване със сливане:"
-#: git-gui.sh:3361
+#: git-gui.sh:3418
msgid "Commit Message:"
msgstr "Съобщение при подаване:"
-#: git-gui.sh:3415 git-gui.sh:3570 lib/console.tcl:73
+#: git-gui.sh:3477 git-gui.sh:3641 lib/console.tcl:73
msgid "Copy All"
msgstr "Копиране на всичко"
-#: git-gui.sh:3439 lib/blame.tcl:105
+#: git-gui.sh:3501 lib/blame.tcl:106
msgid "File:"
msgstr "Файл:"
-#: git-gui.sh:3558
+#: git-gui.sh:3549 lib/choose_repository.tcl:1100
+msgid "Open"
+msgstr "Отваряне"
+
+#: git-gui.sh:3629
msgid "Refresh"
msgstr "Обновяване"
-#: git-gui.sh:3579
+#: git-gui.sh:3650
msgid "Decrease Font Size"
-msgstr "По-едър шрифт"
+msgstr "По-дребен шрифт"
-#: git-gui.sh:3583
+#: git-gui.sh:3654
msgid "Increase Font Size"
-msgstr "По-дребен шрифт"
+msgstr "По-едър шрифт"
-#: git-gui.sh:3591 lib/blame.tcl:294
+#: git-gui.sh:3662 lib/blame.tcl:296
msgid "Encoding"
msgstr "Кодиране"
-#: git-gui.sh:3602
+#: git-gui.sh:3673
msgid "Apply/Reverse Hunk"
msgstr "Прилагане/връщане на парче"
-#: git-gui.sh:3607
+#: git-gui.sh:3678
msgid "Apply/Reverse Line"
msgstr "Прилагане/връщане на ред"
-#: git-gui.sh:3626
+#: git-gui.sh:3684 git-gui.sh:3794 git-gui.sh:3805
+msgid "Revert Hunk"
+msgstr "Връщане на парче"
+
+#: git-gui.sh:3689 git-gui.sh:3801 git-gui.sh:3812
+msgid "Revert Line"
+msgstr "Връщане на ред"
+
+#: git-gui.sh:3694 git-gui.sh:3791
+msgid "Undo Last Revert"
+msgstr "Отмяна на последното връщане"
+
+#: git-gui.sh:3713
msgid "Run Merge Tool"
msgstr "Изпълнение на програмата за сливане"
-#: git-gui.sh:3631
+#: git-gui.sh:3718
msgid "Use Remote Version"
msgstr "Версия от отдалеченото хранилище"
-#: git-gui.sh:3635
+#: git-gui.sh:3722
msgid "Use Local Version"
msgstr "Локална версия"
-#: git-gui.sh:3639
+#: git-gui.sh:3726
msgid "Revert To Base"
msgstr "Връщане към родителската версия"
-#: git-gui.sh:3657
+#: git-gui.sh:3744
msgid "Visualize These Changes In The Submodule"
msgstr "Визуализиране на промените в подмодула"
-#: git-gui.sh:3661
+#: git-gui.sh:3748
msgid "Visualize Current Branch History In The Submodule"
msgstr "Визуализация на историята на текущия клон в историята за подмодула"
-#: git-gui.sh:3665
+#: git-gui.sh:3752
msgid "Visualize All Branch History In The Submodule"
msgstr "Визуализация на историята на всички клони в историята за подмодула"
-#: git-gui.sh:3670
+#: git-gui.sh:3757
msgid "Start git gui In The Submodule"
msgstr "Стартиране на „git gui“ за подмодула"
-#: git-gui.sh:3705
+#: git-gui.sh:3793
msgid "Unstage Hunk From Commit"
msgstr "Изваждане на парчето от подаването"
-#: git-gui.sh:3707
+#: git-gui.sh:3797
msgid "Unstage Lines From Commit"
msgstr "Изваждане на редовете от подаването"
-#: git-gui.sh:3709
+#: git-gui.sh:3798 git-gui.sh:3809
+msgid "Revert Lines"
+msgstr "Връщане на редовете"
+
+#: git-gui.sh:3800
msgid "Unstage Line From Commit"
msgstr "Изваждане на реда от подаването"
-#: git-gui.sh:3712
+#: git-gui.sh:3804
msgid "Stage Hunk For Commit"
msgstr "Добавяне на парчето за подаване"
-#: git-gui.sh:3714
+#: git-gui.sh:3808
msgid "Stage Lines For Commit"
msgstr "Добавяне на редовете за подаване"
-#: git-gui.sh:3716
+#: git-gui.sh:3811
msgid "Stage Line For Commit"
msgstr "Добавяне на реда за подаване"
-#: git-gui.sh:3741
+#: git-gui.sh:3861
msgid "Initializing..."
msgstr "Инициализиране…"
-#: git-gui.sh:3886
+#: git-gui.sh:4017
#, tcl-format
msgid ""
"Possible environment issues exist.\n"
@@ -574,12 +590,12 @@ msgid ""
msgstr ""
"Възможно е да има проблем със средата.\n"
"\n"
-"Най-вероятно следните променливи няма да бъдат\n"
-"взети под внимание от подпроцесите на Git\n"
+"Най-вероятно следните променливи няма да се\n"
+"вземат под внимание от подпроцесите на Git\n"
"от %s:\n"
"\n"
-#: git-gui.sh:3915
+#: git-gui.sh:4046
msgid ""
"\n"
"This is due to a known issue with the\n"
@@ -589,7 +605,7 @@ msgstr ""
"Това е познат проблем и се дължи на\n"
"версията на Tcl включена в Cygwin."
-#: git-gui.sh:3920
+#: git-gui.sh:4051
#, tcl-format
msgid ""
"\n"
@@ -605,341 +621,151 @@ msgstr ""
"е да поставите настройките „user.name“ и\n"
"„user.email“ в личния си файл „~/.gitconfig“.\n"
-#: lib/about.tcl:26
-msgid "git-gui - a graphical user interface for Git."
-msgstr "git-gui — графичен интерфейс за Git."
-
-#: lib/blame.tcl:73
-#, tcl-format
-msgid "%s (%s): File Viewer"
-msgstr "%s (%s): Преглед на файлове"
-
-#: lib/blame.tcl:79
-msgid "Commit:"
-msgstr "Подаване:"
-
-#: lib/blame.tcl:280
-msgid "Copy Commit"
-msgstr "Копиране на подаване"
-
-#: lib/blame.tcl:284
-msgid "Find Text..."
-msgstr "Търсене на текст…"
-
-#: lib/blame.tcl:288
-msgid "Goto Line..."
-msgstr "Към ред…"
-
-#: lib/blame.tcl:297
-msgid "Do Full Copy Detection"
-msgstr "Пълно търсене на копиране"
-
-#: lib/blame.tcl:301
-msgid "Show History Context"
-msgstr "Показване на контекста от историята"
-
-#: lib/blame.tcl:304
-msgid "Blame Parent Commit"
-msgstr "Анотиране на родителското подаване"
-
-#: lib/blame.tcl:466
-#, tcl-format
-msgid "Reading %s..."
-msgstr "Чете се „%s“…"
-
-#: lib/blame.tcl:594
-msgid "Loading copy/move tracking annotations..."
-msgstr "Зареждане на анотациите за проследяване на копирането/преместването…"
-
-#: lib/blame.tcl:614
-msgid "lines annotated"
-msgstr "реда анотирани"
-
-#: lib/blame.tcl:806
-msgid "Loading original location annotations..."
-msgstr "Зареждане на анотациите за първоначалното местоположение…"
-
-#: lib/blame.tcl:809
-msgid "Annotation complete."
-msgstr "Анотирането завърши."
-
-#: lib/blame.tcl:839
-msgid "Busy"
-msgstr "Операцията не е завършила"
-
-#: lib/blame.tcl:840
-msgid "Annotation process is already running."
-msgstr "В момента тече процес на анотиране."
-
-#: lib/blame.tcl:879
-msgid "Running thorough copy detection..."
-msgstr "Изпълнява се цялостен процес на откриване на копиране…"
-
-#: lib/blame.tcl:947
-msgid "Loading annotation..."
-msgstr "Зареждане на анотации…"
-
-#: lib/blame.tcl:1000
-msgid "Author:"
-msgstr "Автор:"
-
-#: lib/blame.tcl:1004
-msgid "Committer:"
-msgstr "Подал:"
-
-#: lib/blame.tcl:1009
-msgid "Original File:"
-msgstr "Първоначален файл:"
-
-#: lib/blame.tcl:1057
-msgid "Cannot find HEAD commit:"
-msgstr "Подаването за връх „HEAD“ не може да се открие:"
-
-#: lib/blame.tcl:1112
-msgid "Cannot find parent commit:"
-msgstr "Родителското подаване не може да бъде открито"
-
-#: lib/blame.tcl:1127
-msgid "Unable to display parent"
-msgstr "Родителят не може да бъде показан"
-
-#: lib/blame.tcl:1128 lib/diff.tcl:358
-msgid "Error loading diff:"
-msgstr "Грешка при зареждане на разлика:"
-
-#: lib/blame.tcl:1269
-msgid "Originally By:"
-msgstr "Първоначално от:"
+#: lib/spellcheck.tcl:57
+msgid "Unsupported spell checker"
+msgstr "Тази програма за проверка на правописа не се поддържа"
-#: lib/blame.tcl:1275
-msgid "In File:"
-msgstr "Във файл:"
+#: lib/spellcheck.tcl:65
+msgid "Spell checking is unavailable"
+msgstr "Липсва програма за проверка на правописа"
-#: lib/blame.tcl:1280
-msgid "Copied Or Moved Here By:"
-msgstr "Копирано или преместено тук от:"
+#: lib/spellcheck.tcl:68
+msgid "Invalid spell checking configuration"
+msgstr "Неправилни настройки на проверката на правописа"
-#: lib/branch_checkout.tcl:16
+#: lib/spellcheck.tcl:70
#, tcl-format
-msgid "%s (%s): Checkout Branch"
-msgstr "%s (%s): Клон за изтегляне"
-
-#: lib/branch_checkout.tcl:21
-msgid "Checkout Branch"
-msgstr "Клон за изтегляне"
-
-#: lib/branch_checkout.tcl:26
-msgid "Checkout"
-msgstr "Изтегляне"
+msgid "Reverting dictionary to %s."
+msgstr "Ползване на речник за език „%s“."
-#: lib/branch_checkout.tcl:30 lib/branch_create.tcl:37 lib/branch_delete.tcl:34
-#: lib/branch_rename.tcl:32 lib/browser.tcl:292 lib/checkout_op.tcl:579
-#: lib/choose_font.tcl:45 lib/merge.tcl:178 lib/option.tcl:127
-#: lib/remote_add.tcl:34 lib/remote_branch_delete.tcl:43 lib/tools_dlg.tcl:41
-#: lib/tools_dlg.tcl:202 lib/tools_dlg.tcl:345 lib/transport.tcl:141
-msgid "Cancel"
-msgstr "Отказване"
+#: lib/spellcheck.tcl:73
+msgid "Spell checker silently failed on startup"
+msgstr "Програмата за правопис даже не стартира успешно."
-#: lib/branch_checkout.tcl:35 lib/browser.tcl:297 lib/tools_dlg.tcl:321
-msgid "Revision"
-msgstr "Версия"
+#: lib/spellcheck.tcl:80
+msgid "Unrecognized spell checker"
+msgstr "Непозната програма за проверка на правописа"
-#: lib/branch_checkout.tcl:39 lib/branch_create.tcl:69 lib/option.tcl:310
-msgid "Options"
-msgstr "Опции"
+#: lib/spellcheck.tcl:186
+msgid "No Suggestions"
+msgstr "Няма предложения"
-#: lib/branch_checkout.tcl:42 lib/branch_create.tcl:92
-msgid "Fetch Tracking Branch"
-msgstr "Изтегляне на промените от следения клон"
+#: lib/spellcheck.tcl:388
+msgid "Unexpected EOF from spell checker"
+msgstr "Неочакван край на файл от програмата за проверка на правописа"
-#: lib/branch_checkout.tcl:47
-msgid "Detach From Local Branch"
-msgstr "Изтриване от локалния клон"
+#: lib/spellcheck.tcl:392
+msgid "Spell Checker Failed"
+msgstr "Грешка в програмата за проверка на правописа"
-#: lib/branch_create.tcl:23
+#: lib/transport.tcl:6 lib/remote_add.tcl:132
#, tcl-format
-msgid "%s (%s): Create Branch"
-msgstr "%s (%s): Създаване на клон"
-
-#: lib/branch_create.tcl:28
-msgid "Create New Branch"
-msgstr "Създаване на нов клон"
-
-#: lib/branch_create.tcl:33 lib/choose_repository.tcl:407
-msgid "Create"
-msgstr "Създаване"
-
-#: lib/branch_create.tcl:42
-msgid "Branch Name"
-msgstr "Име на клона"
-
-#: lib/branch_create.tcl:44 lib/remote_add.tcl:41 lib/tools_dlg.tcl:51
-msgid "Name:"
-msgstr "Име:"
-
-#: lib/branch_create.tcl:57
-msgid "Match Tracking Branch Name"
-msgstr "Съвпадане по името на следения клон"
-
-#: lib/branch_create.tcl:66
-msgid "Starting Revision"
-msgstr "Начална версия"
-
-#: lib/branch_create.tcl:72
-msgid "Update Existing Branch:"
-msgstr "Обновяване на съществуващ клон:"
-
-#: lib/branch_create.tcl:75
-msgid "No"
-msgstr "Не"
-
-#: lib/branch_create.tcl:80
-msgid "Fast Forward Only"
-msgstr "Само тривиално превъртащо сливане"
-
-#: lib/branch_create.tcl:85 lib/checkout_op.tcl:571
-msgid "Reset"
-msgstr "Отначало"
-
-#: lib/branch_create.tcl:97
-msgid "Checkout After Creation"
-msgstr "Преминаване към клона след създаването му"
-
-#: lib/branch_create.tcl:132
-msgid "Please select a tracking branch."
-msgstr "Изберете клон за следени."
+msgid "fetch %s"
+msgstr "доставяне на „%s“"
-#: lib/branch_create.tcl:141
+#: lib/transport.tcl:7
#, tcl-format
-msgid "Tracking branch %s is not a branch in the remote repository."
-msgstr "Следящият клон — „%s“, не съществува в отдалеченото хранилище."
-
-#: lib/branch_create.tcl:154 lib/branch_rename.tcl:92
-msgid "Please supply a branch name."
-msgstr "Дайте име на клона."
+msgid "Fetching new changes from %s"
+msgstr "Доставяне на промените от „%s“"
-#: lib/branch_create.tcl:165 lib/branch_rename.tcl:112
+#: lib/transport.tcl:18
#, tcl-format
-msgid "'%s' is not an acceptable branch name."
-msgstr "„%s“ не може да се използва за име на клон."
+msgid "remote prune %s"
+msgstr "окастряне на следящите клони към „%s“"
-#: lib/branch_delete.tcl:16
+#: lib/transport.tcl:19
#, tcl-format
-msgid "%s (%s): Delete Branch"
-msgstr "%s (%s): Изтриване на клон"
-
-#: lib/branch_delete.tcl:21
-msgid "Delete Local Branch"
-msgstr "Изтриване на локален клон"
-
-#: lib/branch_delete.tcl:39
-msgid "Local Branches"
-msgstr "Локални клони"
+msgid "Pruning tracking branches deleted from %s"
+msgstr "Окастряне на следящите клони на изтритите клони от „%s“"
-#: lib/branch_delete.tcl:51
-msgid "Delete Only If Merged Into"
-msgstr "Изтриване, само ако промените са слети и другаде"
+#: lib/transport.tcl:25
+msgid "fetch all remotes"
+msgstr "доставяне от всички отдалечени"
-#: lib/branch_delete.tcl:53 lib/remote_branch_delete.tcl:120
-msgid "Always (Do not perform merge checks)"
-msgstr "Винаги (без проверка за сливане)"
+#: lib/transport.tcl:26
+msgid "Fetching new changes from all remotes"
+msgstr "Доставяне на промените от всички отдалечени хранилища"
-#: lib/branch_delete.tcl:103
-#, tcl-format
-msgid "The following branches are not completely merged into %s:"
-msgstr "Не всички промени в клоните са слети в „%s“:"
+#: lib/transport.tcl:40
+msgid "remote prune all remotes"
+msgstr "окастряне на следящите изтрити"
-#: lib/branch_delete.tcl:115 lib/remote_branch_delete.tcl:218
-msgid ""
-"Recovering deleted branches is difficult.\n"
-"\n"
-"Delete the selected branches?"
+#: lib/transport.tcl:41
+msgid "Pruning tracking branches deleted from all remotes"
msgstr ""
-"Възстановяването на изтрити клони може да е трудно.\n"
-"\n"
-"Сигурни ли сте, че искате да триете?"
+"Окастряне на следящите клони на изтритите клони от всички отдалечени "
+"хранилища"
-#: lib/branch_delete.tcl:131
+#: lib/transport.tcl:54 lib/transport.tcl:92 lib/transport.tcl:110
+#: lib/remote_add.tcl:162
#, tcl-format
-msgid " - %s:"
-msgstr " — „%s:“"
+msgid "push %s"
+msgstr "изтласкване на „%s“"
-#: lib/branch_delete.tcl:141
+#: lib/transport.tcl:55
#, tcl-format
-msgid ""
-"Failed to delete branches:\n"
-"%s"
-msgstr ""
-"Неуспешно триене на клони:\n"
-"%s"
+msgid "Pushing changes to %s"
+msgstr "Изтласкване на промените към „%s“"
-#: lib/branch_rename.tcl:15
+#: lib/transport.tcl:93
#, tcl-format
-msgid "%s (%s): Rename Branch"
-msgstr "%s (%s): Преименуване на клон"
+msgid "Mirroring to %s"
+msgstr "Изтласкване на всичко към „%s“"
-#: lib/branch_rename.tcl:23
-msgid "Rename Branch"
-msgstr "Преименуване на клон"
+#: lib/transport.tcl:111
+#, tcl-format
+msgid "Pushing %s %s to %s"
+msgstr "Изтласкване на %s „%s“ към „%s“"
-#: lib/branch_rename.tcl:28
-msgid "Rename"
-msgstr "Преименуване"
+#: lib/transport.tcl:132
+msgid "Push Branches"
+msgstr "Клони за изтласкване"
-#: lib/branch_rename.tcl:38
-msgid "Branch:"
-msgstr "Клон:"
+#: lib/transport.tcl:141 lib/checkout_op.tcl:580 lib/remote_add.tcl:34
+#: lib/browser.tcl:292 lib/branch_checkout.tcl:30 lib/branch_rename.tcl:32
+#: lib/choose_font.tcl:45 lib/option.tcl:127 lib/tools_dlg.tcl:41
+#: lib/tools_dlg.tcl:202 lib/tools_dlg.tcl:345 lib/remote_branch_delete.tcl:43
+#: lib/branch_create.tcl:37 lib/branch_delete.tcl:34 lib/merge.tcl:178
+msgid "Cancel"
+msgstr "Отказване"
-#: lib/branch_rename.tcl:46
-msgid "New Name:"
-msgstr "Ново име:"
+#: lib/transport.tcl:147
+msgid "Source Branches"
+msgstr "Клони-източници"
-#: lib/branch_rename.tcl:81
-msgid "Please select a branch to rename."
-msgstr "Изберете клон за преименуване."
+#: lib/transport.tcl:162
+msgid "Destination Repository"
+msgstr "Целево хранилище"
-#: lib/branch_rename.tcl:102 lib/checkout_op.tcl:202
-#, tcl-format
-msgid "Branch '%s' already exists."
-msgstr "Клонът „%s“ вече съществува."
+#: lib/transport.tcl:165 lib/remote_branch_delete.tcl:51
+msgid "Remote:"
+msgstr "Отдалечено хранилище:"
-#: lib/branch_rename.tcl:123
-#, tcl-format
-msgid "Failed to rename '%s'."
-msgstr "Неуспешно преименуване на „%s“."
+#: lib/transport.tcl:187 lib/remote_branch_delete.tcl:72
+msgid "Arbitrary Location:"
+msgstr "Произволно местоположение:"
-#: lib/browser.tcl:17
-msgid "Starting..."
-msgstr "Стартиране…"
+#: lib/transport.tcl:205
+msgid "Transfer Options"
+msgstr "Настройки при пренасянето"
-#: lib/browser.tcl:27
-#, tcl-format
-msgid "%s (%s): File Browser"
-msgstr "%s (%s): Файлов браузър"
+#: lib/transport.tcl:207
+msgid "Force overwrite existing branch (may discard changes)"
+msgstr ""
+"Изрично презаписване на съществуващ клон (някои промени може да се загубят)"
-#: lib/browser.tcl:132 lib/browser.tcl:149
-#, tcl-format
-msgid "Loading %s..."
-msgstr "Зареждане на „%s“…"
+#: lib/transport.tcl:211
+msgid "Use thin pack (for slow network connections)"
+msgstr "Максимална компресия (за бавни мрежови връзки)"
-#: lib/browser.tcl:193
-msgid "[Up To Parent]"
-msgstr "[Към родителя]"
+#: lib/transport.tcl:215
+msgid "Include tags"
+msgstr "Включване на етикетите"
-#: lib/browser.tcl:275
+#: lib/transport.tcl:229
#, tcl-format
-msgid "%s (%s): Browse Branch Files"
-msgstr "%s (%s): Разглеждане на файловете в клона"
-
-#: lib/browser.tcl:282
-msgid "Browse Branch Files"
-msgstr "Разглеждане на файловете в клона"
-
-#: lib/browser.tcl:288 lib/choose_repository.tcl:422
-#: lib/choose_repository.tcl:509 lib/choose_repository.tcl:518
-#: lib/choose_repository.tcl:1074
-msgid "Browse"
-msgstr "Разглеждане"
+msgid "%s (%s): Push"
+msgstr "%s (%s): Изтласкване"
#: lib/checkout_op.tcl:85
#, tcl-format
@@ -951,8 +777,8 @@ msgstr "Доставяне на „%s“ от „%s“"
msgid "fatal: Cannot resolve %s"
msgstr "фатална грешка: „%s“ не може да се открие"
-#: lib/checkout_op.tcl:146 lib/console.tcl:81 lib/database.tcl:30
-#: lib/sshkey.tcl:55
+#: lib/checkout_op.tcl:146 lib/sshkey.tcl:58 lib/console.tcl:81
+#: lib/database.tcl:30
msgid "Close"
msgstr "Затваряне"
@@ -966,6 +792,11 @@ msgstr "Клонът „%s“ не съществува."
msgid "Failed to configure simplified git-pull for '%s'."
msgstr "Неуспешно настройване на опростен git-pull за „%s“."
+#: lib/checkout_op.tcl:202 lib/branch_rename.tcl:102
+#, tcl-format
+msgid "Branch '%s' already exists."
+msgstr "Клонът „%s“ вече съществува."
+
#: lib/checkout_op.tcl:229
#, tcl-format
msgid ""
@@ -976,13 +807,13 @@ msgid ""
msgstr ""
"Клонът „%s“ съществува.\n"
"\n"
-"Той не може да бъде тривиално слят до „%s“.\n"
+"Той не може да се слее тривиално до „%s“.\n"
"Необходимо е сливане."
#: lib/checkout_op.tcl:243
#, tcl-format
msgid "Merge strategy '%s' not supported."
-msgstr "Стратегия за сливане „%s“ не се поддържа."
+msgstr "Стратегия за сливане „%s“ не се поддържа."
#: lib/checkout_op.tcl:262
#, tcl-format
@@ -1006,7 +837,7 @@ msgstr ""
"хранилището.\n"
"\n"
"Някой друг процес за Git е променил хранилището междувременно. Състоянието "
-"трябва да бъде проверено, преди да се премине към нов клон.\n"
+"трябва да се провери, преди да се премине към нов клон.\n"
"\n"
"Автоматично ще започне нова проверка.\n"
@@ -1019,22 +850,22 @@ msgstr "Работната директория се привежда към „
msgid "files checked out"
msgstr "файла са изтеглени"
-#: lib/checkout_op.tcl:376
+#: lib/checkout_op.tcl:377
#, tcl-format
msgid "Aborted checkout of '%s' (file level merging is required)."
msgstr ""
"Преустановяване на изтеглянето на „%s“ (необходимо е пофайлово сливане)."
-#: lib/checkout_op.tcl:377
+#: lib/checkout_op.tcl:378
msgid "File level merge required."
msgstr "Необходимо е пофайлово сливане."
-#: lib/checkout_op.tcl:381
+#: lib/checkout_op.tcl:382
#, tcl-format
msgid "Staying on branch '%s'."
msgstr "Оставане върху клона „%s“."
-#: lib/checkout_op.tcl:452
+#: lib/checkout_op.tcl:453
msgid ""
"You are no longer on a local branch.\n"
"\n"
@@ -1045,31 +876,35 @@ msgstr ""
"\n"
"Ако искате да сте на клон, създайте базиран на „Това несвързано изтегляне“."
-#: lib/checkout_op.tcl:503 lib/checkout_op.tcl:507
+#: lib/checkout_op.tcl:504 lib/checkout_op.tcl:508
#, tcl-format
msgid "Checked out '%s'."
msgstr "„%s“ е изтеглен."
-#: lib/checkout_op.tcl:535
+#: lib/checkout_op.tcl:536
#, tcl-format
msgid "Resetting '%s' to '%s' will lose the following commits:"
msgstr ""
"Зануляването на „%s“ към „%s“ ще доведе до загубването на следните подавания:"
-#: lib/checkout_op.tcl:557
+#: lib/checkout_op.tcl:558
msgid "Recovering lost commits may not be easy."
msgstr "Възстановяването на загубените подавания може да е трудно."
-#: lib/checkout_op.tcl:562
+#: lib/checkout_op.tcl:563
#, tcl-format
msgid "Reset '%s'?"
msgstr "Зануляване на „%s“?"
-#: lib/checkout_op.tcl:567 lib/merge.tcl:170 lib/tools_dlg.tcl:336
+#: lib/checkout_op.tcl:568 lib/tools_dlg.tcl:336 lib/merge.tcl:170
msgid "Visualize"
msgstr "Визуализация"
-#: lib/checkout_op.tcl:635
+#: lib/checkout_op.tcl:572 lib/branch_create.tcl:85
+msgid "Reset"
+msgstr "Отначало"
+
+#: lib/checkout_op.tcl:636
#, tcl-format
msgid ""
"Failed to set current branch.\n"
@@ -1087,6 +922,327 @@ msgstr ""
"Това състояние е аварийно и не трябва да се случва. Програмата „%s“ ще "
"преустанови работа."
+#: lib/remote_add.tcl:20
+#, tcl-format
+msgid "%s (%s): Add Remote"
+msgstr "%s (%s): Добавяне на отдалечено хранилище"
+
+#: lib/remote_add.tcl:25
+msgid "Add New Remote"
+msgstr "Добавяне на отдалечено хранилище"
+
+#: lib/remote_add.tcl:30 lib/tools_dlg.tcl:37
+msgid "Add"
+msgstr "Добавяне"
+
+#: lib/remote_add.tcl:39
+msgid "Remote Details"
+msgstr "Данни за отдалеченото хранилище"
+
+#: lib/remote_add.tcl:41 lib/tools_dlg.tcl:51 lib/branch_create.tcl:44
+msgid "Name:"
+msgstr "Име:"
+
+#: lib/remote_add.tcl:50
+msgid "Location:"
+msgstr "Местоположение:"
+
+#: lib/remote_add.tcl:60
+msgid "Further Action"
+msgstr "Следващо действие"
+
+#: lib/remote_add.tcl:63
+msgid "Fetch Immediately"
+msgstr "Незабавно доставяне"
+
+#: lib/remote_add.tcl:69
+msgid "Initialize Remote Repository and Push"
+msgstr "Инициализиране на отдалеченото хранилище и изтласкване на промените"
+
+#: lib/remote_add.tcl:75
+msgid "Do Nothing Else Now"
+msgstr "Да не се прави нищо"
+
+#: lib/remote_add.tcl:100
+msgid "Please supply a remote name."
+msgstr "Задайте име за отдалеченото хранилище."
+
+#: lib/remote_add.tcl:113
+#, tcl-format
+msgid "'%s' is not an acceptable remote name."
+msgstr "Отдалечено хранилище не може да се казва „%s“."
+
+#: lib/remote_add.tcl:124
+#, tcl-format
+msgid "Failed to add remote '%s' of location '%s'."
+msgstr "Неуспешно добавяне на отдалеченото хранилище „%s“ от адрес „%s“."
+
+#: lib/remote_add.tcl:133
+#, tcl-format
+msgid "Fetching the %s"
+msgstr "Доставяне на „%s“"
+
+#: lib/remote_add.tcl:156
+#, tcl-format
+msgid "Do not know how to initialize repository at location '%s'."
+msgstr "Хранилището с местоположение „%s“ не може да се инициализира."
+
+#: lib/remote_add.tcl:163
+#, tcl-format
+msgid "Setting up the %s (at %s)"
+msgstr "Добавяне на хранилище „%s“ (с адрес „%s“)"
+
+#: lib/browser.tcl:17
+msgid "Starting..."
+msgstr "Стартиране…"
+
+#: lib/browser.tcl:27
+#, tcl-format
+msgid "%s (%s): File Browser"
+msgstr "%s (%s): Файлов браузър"
+
+#: lib/browser.tcl:132 lib/browser.tcl:149
+#, tcl-format
+msgid "Loading %s..."
+msgstr "Зареждане на „%s“…"
+
+#: lib/browser.tcl:193
+msgid "[Up To Parent]"
+msgstr "[Към родителя]"
+
+#: lib/browser.tcl:275
+#, tcl-format
+msgid "%s (%s): Browse Branch Files"
+msgstr "%s (%s): Разглеждане на файловете в клона"
+
+#: lib/browser.tcl:282
+msgid "Browse Branch Files"
+msgstr "Разглеждане на файловете в клона"
+
+#: lib/browser.tcl:288 lib/choose_repository.tcl:437
+#: lib/choose_repository.tcl:524 lib/choose_repository.tcl:533
+#: lib/choose_repository.tcl:1115
+msgid "Browse"
+msgstr "Разглеждане"
+
+#: lib/browser.tcl:297 lib/branch_checkout.tcl:35 lib/tools_dlg.tcl:321
+msgid "Revision"
+msgstr "Версия"
+
+#: lib/index.tcl:6
+msgid "Unable to unlock the index."
+msgstr "Индексът не може да се отключи."
+
+#: lib/index.tcl:30
+msgid "Index Error"
+msgstr "Грешка в индекса"
+
+#: lib/index.tcl:32
+msgid ""
+"Updating the Git index failed. A rescan will be automatically started to "
+"resynchronize git-gui."
+msgstr ""
+"Неуспешно обновяване на индекса на Git. Автоматично ще започне нова проверка "
+"за синхронизирането на git-gui."
+
+#: lib/index.tcl:43
+msgid "Continue"
+msgstr "Продължаване"
+
+#: lib/index.tcl:46
+msgid "Unlock Index"
+msgstr "Отключване на индекса"
+
+#: lib/index.tcl:77 lib/index.tcl:146 lib/index.tcl:220 lib/index.tcl:587
+#: lib/choose_repository.tcl:999
+msgid "files"
+msgstr "файлове"
+
+#: lib/index.tcl:326
+msgid "Unstaging selected files from commit"
+msgstr "Изваждане на избраните файлове от подаването"
+
+#: lib/index.tcl:330
+#, tcl-format
+msgid "Unstaging %s from commit"
+msgstr "Изваждане на „%s“ от подаването"
+
+#: lib/index.tcl:369
+msgid "Ready to commit."
+msgstr "Готовност за подаване."
+
+#: lib/index.tcl:378
+msgid "Adding selected files"
+msgstr "Добавяне на избраните файлове"
+
+#: lib/index.tcl:382
+#, tcl-format
+msgid "Adding %s"
+msgstr "Добавяне на „%s“"
+
+#: lib/index.tcl:412
+#, tcl-format
+msgid "Stage %d untracked files?"
+msgstr "Да се добавят ли %d неследени файла към индекса?"
+
+#: lib/index.tcl:420
+msgid "Adding all changed files"
+msgstr "Добавяне на всички променени файлове"
+
+#: lib/index.tcl:503
+#, tcl-format
+msgid "Revert changes in file %s?"
+msgstr "Да се махнат ли промените във файла „%s“?"
+
+#: lib/index.tcl:508
+#, tcl-format
+msgid "Revert changes in these %i files?"
+msgstr "Да се махнат ли промените в тези %i файла?"
+
+#: lib/index.tcl:517
+msgid "Any unstaged changes will be permanently lost by the revert."
+msgstr ""
+"Всички промени, които не са били добавени в индекса, ще се загубят "
+"безвъзвратно."
+
+#: lib/index.tcl:520 lib/index.tcl:563
+msgid "Do Nothing"
+msgstr "Нищо да не се прави"
+
+#: lib/index.tcl:545
+#, tcl-format
+msgid "Delete untracked file %s?"
+msgstr "Да се изтрие ли неследеният файл „%s“?"
+
+#: lib/index.tcl:550
+#, tcl-format
+msgid "Delete these %i untracked files?"
+msgstr "Да се изтрият ли тези %d неследени файла?"
+
+#: lib/index.tcl:560
+msgid "Files will be permanently deleted."
+msgstr "Файловете ще се изтрият окончателно."
+
+#: lib/index.tcl:564
+msgid "Delete Files"
+msgstr "Изтриване на файлове"
+
+#: lib/index.tcl:586
+msgid "Deleting"
+msgstr "Изтриване"
+
+#: lib/index.tcl:665
+msgid "Encountered errors deleting files:\n"
+msgstr "Грешки при изтриване на файловете:\n"
+
+#: lib/index.tcl:674
+#, tcl-format
+msgid "None of the %d selected files could be deleted."
+msgstr "Никой от избраните %d файла не бе изтрит."
+
+#: lib/index.tcl:679
+#, tcl-format
+msgid "%d of the %d selected files could not be deleted."
+msgstr "%d от избраните %d файла не бяха изтрити."
+
+#: lib/index.tcl:726
+msgid "Reverting selected files"
+msgstr "Махане на промените в избраните файлове"
+
+#: lib/index.tcl:730
+#, tcl-format
+msgid "Reverting %s"
+msgstr "Махане на промените в „%s“"
+
+#: lib/branch_checkout.tcl:16
+#, tcl-format
+msgid "%s (%s): Checkout Branch"
+msgstr "%s (%s): Клон за изтегляне"
+
+#: lib/branch_checkout.tcl:21
+msgid "Checkout Branch"
+msgstr "Клон за изтегляне"
+
+#: lib/branch_checkout.tcl:26
+msgid "Checkout"
+msgstr "Изтегляне"
+
+#: lib/branch_checkout.tcl:39 lib/option.tcl:310 lib/branch_create.tcl:69
+msgid "Options"
+msgstr "Опции"
+
+#: lib/branch_checkout.tcl:42 lib/branch_create.tcl:92
+msgid "Fetch Tracking Branch"
+msgstr "Изтегляне на промените от следения клон"
+
+#: lib/branch_checkout.tcl:47
+msgid "Detach From Local Branch"
+msgstr "Изтриване от локалния клон"
+
+#: lib/status_bar.tcl:263
+#, tcl-format
+msgid "%s ... %*i of %*i %s (%3i%%)"
+msgstr "%s… %*i от общо %*i %s (%3i%%)"
+
+#: lib/remote.tcl:200
+msgid "Push to"
+msgstr "Изтласкване към"
+
+#: lib/remote.tcl:218
+msgid "Remove Remote"
+msgstr "Премахване на отдалечено хранилище"
+
+#: lib/remote.tcl:223
+msgid "Prune from"
+msgstr "Окастряне от"
+
+#: lib/remote.tcl:228
+msgid "Fetch from"
+msgstr "Доставяне от"
+
+#: lib/remote.tcl:249 lib/remote.tcl:253 lib/remote.tcl:258 lib/remote.tcl:264
+msgid "All"
+msgstr "Всички"
+
+#: lib/branch_rename.tcl:15
+#, tcl-format
+msgid "%s (%s): Rename Branch"
+msgstr "%s (%s): Преименуване на клон"
+
+#: lib/branch_rename.tcl:23
+msgid "Rename Branch"
+msgstr "Преименуване на клон"
+
+#: lib/branch_rename.tcl:28
+msgid "Rename"
+msgstr "Преименуване"
+
+#: lib/branch_rename.tcl:38
+msgid "Branch:"
+msgstr "Клон:"
+
+#: lib/branch_rename.tcl:46
+msgid "New Name:"
+msgstr "Ново име:"
+
+#: lib/branch_rename.tcl:81
+msgid "Please select a branch to rename."
+msgstr "Изберете клон за преименуване."
+
+#: lib/branch_rename.tcl:92 lib/branch_create.tcl:154
+msgid "Please supply a branch name."
+msgstr "Дайте име на клона."
+
+#: lib/branch_rename.tcl:112 lib/branch_create.tcl:165
+#, tcl-format
+msgid "'%s' is not an acceptable branch name."
+msgstr "„%s“ не може да се използва за име на клон."
+
+#: lib/branch_rename.tcl:123
+#, tcl-format
+msgid "Failed to rename '%s'."
+msgstr "Неуспешно преименуване на „%s“."
+
#: lib/choose_font.tcl:41
msgid "Select"
msgstr "Избор"
@@ -1111,251 +1267,1099 @@ msgstr ""
"Това е примерен текст.\n"
"Ако ви харесва как изглежда, изберете шрифта."
-#: lib/choose_repository.tcl:33
+#: lib/option.tcl:11
+#, tcl-format
+msgid "Invalid global encoding '%s'"
+msgstr "Неправилно глобално кодиране „%s“"
+
+#: lib/option.tcl:19
+#, tcl-format
+msgid "Invalid repo encoding '%s'"
+msgstr "Неправилно кодиране „%s“ на хранилището"
+
+#: lib/option.tcl:119
+msgid "Restore Defaults"
+msgstr "Стандартни настройки"
+
+#: lib/option.tcl:123
+msgid "Save"
+msgstr "Запазване"
+
+#: lib/option.tcl:133
+#, tcl-format
+msgid "%s Repository"
+msgstr "Хранилище „%s“"
+
+#: lib/option.tcl:134
+msgid "Global (All Repositories)"
+msgstr "Глобално (за всички хранилища)"
+
+#: lib/option.tcl:140
+msgid "User Name"
+msgstr "Потребителско име"
+
+#: lib/option.tcl:141
+msgid "Email Address"
+msgstr "Адрес на е-поща"
+
+#: lib/option.tcl:143
+msgid "Summarize Merge Commits"
+msgstr "Обобщаване на подаванията при сливане"
+
+#: lib/option.tcl:144
+msgid "Merge Verbosity"
+msgstr "Подробности при сливанията"
+
+#: lib/option.tcl:145
+msgid "Show Diffstat After Merge"
+msgstr "Извеждане на статистика след сливанията"
+
+#: lib/option.tcl:146
+msgid "Use Merge Tool"
+msgstr "Използване на програма за сливане"
+
+#: lib/option.tcl:148
+msgid "Trust File Modification Timestamps"
+msgstr "Доверие във времето на промяна на файловете"
+
+#: lib/option.tcl:149
+msgid "Prune Tracking Branches During Fetch"
+msgstr "Окастряне на следящите клонове при доставяне"
+
+#: lib/option.tcl:150
+msgid "Match Tracking Branches"
+msgstr "Напасване на следящите клонове"
+
+#: lib/option.tcl:151
+msgid "Use Textconv For Diffs and Blames"
+msgstr "Използване на „textconv“ за разликите и анотирането"
+
+#: lib/option.tcl:152
+msgid "Blame Copy Only On Changed Files"
+msgstr "Анотиране на копието само по променените файлове"
+
+#: lib/option.tcl:153
+msgid "Maximum Length of Recent Repositories List"
+msgstr "Максимален брой на списъка „Скоро ползвани“ хранилища"
+
+#: lib/option.tcl:154
+msgid "Minimum Letters To Blame Copy On"
+msgstr "Минимален брой знаци за анотиране на копието"
+
+#: lib/option.tcl:155
+msgid "Blame History Context Radius (days)"
+msgstr "Исторически обхват за анотиране в дни"
+
+#: lib/option.tcl:156
+msgid "Number of Diff Context Lines"
+msgstr "Брой редове за контекста на разликите"
+
+#: lib/option.tcl:157
+msgid "Additional Diff Parameters"
+msgstr "Аргументи към командата за разликите"
+
+#: lib/option.tcl:158
+msgid "Commit Message Text Width"
+msgstr "Широчина на текста на съобщението при подаване"
+
+#: lib/option.tcl:159
+msgid "New Branch Name Template"
+msgstr "Шаблон за името на новите клони"
+
+#: lib/option.tcl:160
+msgid "Default File Contents Encoding"
+msgstr "Кодиране на файловете"
+
+#: lib/option.tcl:161
+msgid "Warn before committing to a detached head"
+msgstr "Предупреждаване при подаване към несвързан указател"
+
+#: lib/option.tcl:162
+msgid "Staging of untracked files"
+msgstr "Добавяне на неследените файлове към индекса"
+
+#: lib/option.tcl:163
+msgid "Show untracked files"
+msgstr "Показване на неследените файлове"
+
+#: lib/option.tcl:164
+msgid "Tab spacing"
+msgstr "Ширина на табулацията"
+
+#: lib/option.tcl:182 lib/option.tcl:197 lib/option.tcl:220 lib/option.tcl:282
+#: lib/database.tcl:57
+#, tcl-format
+msgid "%s:"
+msgstr "%s:"
+
+#: lib/option.tcl:210
+msgid "Change"
+msgstr "Смяна"
+
+#: lib/option.tcl:254
+msgid "Spelling Dictionary:"
+msgstr "Правописен речник:"
+
+#: lib/option.tcl:284
+msgid "Change Font"
+msgstr "Смяна на шрифта"
+
+#: lib/option.tcl:288
+#, tcl-format
+msgid "Choose %s"
+msgstr "Избор на „%s“"
+
+#: lib/option.tcl:294
+msgid "pt."
+msgstr "тчк."
+
+#: lib/option.tcl:308
+msgid "Preferences"
+msgstr "Настройки"
+
+#: lib/option.tcl:345
+msgid "Failed to completely save options:"
+msgstr "Неуспешно запазване на настройките:"
+
+#: lib/encoding.tcl:443
+msgid "Default"
+msgstr "Стандартното"
+
+#: lib/encoding.tcl:448
+#, tcl-format
+msgid "System (%s)"
+msgstr "Системното (%s)"
+
+#: lib/encoding.tcl:459 lib/encoding.tcl:465
+msgid "Other"
+msgstr "Друго"
+
+#: lib/tools.tcl:76
+#, tcl-format
+msgid "Running %s requires a selected file."
+msgstr "За изпълнението на „%s“ трябва да изберете файл."
+
+#: lib/tools.tcl:92
+#, tcl-format
+msgid "Are you sure you want to run %1$s on file \"%2$s\"?"
+msgstr "Сигурни ли сте, че искате да изпълните „%1$s“ върху файла „%2$s“?"
+
+#: lib/tools.tcl:96
+#, tcl-format
+msgid "Are you sure you want to run %s?"
+msgstr "Сигурни ли сте, че искате да изпълните „%s“?"
+
+#: lib/tools.tcl:118
+#, tcl-format
+msgid "Tool: %s"
+msgstr "Команда: %s"
+
+#: lib/tools.tcl:119
+#, tcl-format
+msgid "Running: %s"
+msgstr "Изпълнение: %s"
+
+#: lib/tools.tcl:158
+#, tcl-format
+msgid "Tool completed successfully: %s"
+msgstr "Командата завърши успешно: %s"
+
+#: lib/tools.tcl:160
+#, tcl-format
+msgid "Tool failed: %s"
+msgstr "Командата върна грешка: %s"
+
+#: lib/mergetool.tcl:8
+msgid "Force resolution to the base version?"
+msgstr "Да се използва базовата версия"
+
+#: lib/mergetool.tcl:9
+msgid "Force resolution to this branch?"
+msgstr "Да се използва версията от този клон"
+
+#: lib/mergetool.tcl:10
+msgid "Force resolution to the other branch?"
+msgstr "Да се използва версията от другия клон"
+
+#: lib/mergetool.tcl:14
+#, tcl-format
+msgid ""
+"Note that the diff shows only conflicting changes.\n"
+"\n"
+"%s will be overwritten.\n"
+"\n"
+"This operation can be undone only by restarting the merge."
+msgstr ""
+"Разликата показва само разликите с конфликт.\n"
+"\n"
+"Файлът „%s“ ще се презапише.\n"
+"\n"
+"Тази операция може да се отмени само чрез започване на сливането наново."
+
+#: lib/mergetool.tcl:45
+#, tcl-format
+msgid "File %s seems to have unresolved conflicts, still stage?"
+msgstr ""
+"Изглежда, че все още има некоригирани конфликти във файла „%s“. Да се добави "
+"ли файлът към индекса?"
+
+#: lib/mergetool.tcl:60
+#, tcl-format
+msgid "Adding resolution for %s"
+msgstr "Добавяне на корекция на конфликтите в „%s“"
+
+#: lib/mergetool.tcl:141
+msgid "Cannot resolve deletion or link conflicts using a tool"
+msgstr ""
+"Конфликтите при символни връзки или изтриване не може да се коригират с "
+"външна програма."
+
+#: lib/mergetool.tcl:146
+msgid "Conflict file does not exist"
+msgstr "Файлът, в който е конфликтът, не съществува"
+
+#: lib/mergetool.tcl:246
+#, tcl-format
+msgid "Not a GUI merge tool: '%s'"
+msgstr "Това не е графична програма за сливане: „%s“"
+
+#: lib/mergetool.tcl:275
+#, tcl-format
+msgid "Unsupported merge tool '%s'"
+msgstr "Неподдържана програма за сливане: „%s“"
+
+#: lib/mergetool.tcl:310
+msgid "Merge tool is already running, terminate it?"
+msgstr "Програмата за сливане вече е стартирана. Да се изключи ли?"
+
+#: lib/mergetool.tcl:330
+#, tcl-format
+msgid ""
+"Error retrieving versions:\n"
+"%s"
+msgstr ""
+"Грешка при изтеглянето на версии:\n"
+"%s"
+
+#: lib/mergetool.tcl:350
+#, tcl-format
+msgid ""
+"Could not start the merge tool:\n"
+"\n"
+"%s"
+msgstr ""
+"Програмата за сливане не може да се стартира:\n"
+"\n"
+"%s"
+
+#: lib/mergetool.tcl:354
+msgid "Running merge tool..."
+msgstr "Стартиране на програмата за сливане…"
+
+#: lib/mergetool.tcl:382 lib/mergetool.tcl:390
+msgid "Merge tool failed."
+msgstr "Грешка в програмата за сливане."
+
+#: lib/tools_dlg.tcl:22
+#, tcl-format
+msgid "%s (%s): Add Tool"
+msgstr "%s (%s): Добавяне на команда"
+
+#: lib/tools_dlg.tcl:28
+msgid "Add New Tool Command"
+msgstr "Добавяне на команда"
+
+#: lib/tools_dlg.tcl:34
+msgid "Add globally"
+msgstr "Глобално добавяне"
+
+#: lib/tools_dlg.tcl:46
+msgid "Tool Details"
+msgstr "Подробности за командата"
+
+#: lib/tools_dlg.tcl:49
+msgid "Use '/' separators to create a submenu tree:"
+msgstr "За създаване на подменюта използвайте знака „/“ за разделител:"
+
+#: lib/tools_dlg.tcl:60
+msgid "Command:"
+msgstr "Команда:"
+
+#: lib/tools_dlg.tcl:71
+msgid "Show a dialog before running"
+msgstr "Преди изпълнение да се извежда диалогов прозорец"
+
+#: lib/tools_dlg.tcl:77
+msgid "Ask the user to select a revision (sets $REVISION)"
+msgstr "Потребителят да укаже версия (задаване на променливата $REVISION)"
+
+#: lib/tools_dlg.tcl:82
+msgid "Ask the user for additional arguments (sets $ARGS)"
+msgstr ""
+"Потребителят да укаже допълнителни аргументи (задаване на променливата $ARGS)"
+
+#: lib/tools_dlg.tcl:89
+msgid "Don't show the command output window"
+msgstr "Без показване на прозорец с изхода от командата"
+
+#: lib/tools_dlg.tcl:94
+msgid "Run only if a diff is selected ($FILENAME not empty)"
+msgstr ""
+"Стартиране само след избор на разлика (променливата $FILENAME не е празна)"
+
+#: lib/tools_dlg.tcl:118
+msgid "Please supply a name for the tool."
+msgstr "Задайте име за командата."
+
+#: lib/tools_dlg.tcl:126
+#, tcl-format
+msgid "Tool '%s' already exists."
+msgstr "Командата „%s“ вече съществува."
+
+#: lib/tools_dlg.tcl:148
+#, tcl-format
+msgid ""
+"Could not add tool:\n"
+"%s"
+msgstr ""
+"Командата не може да се добави:\n"
+"%s"
+
+#: lib/tools_dlg.tcl:187
+#, tcl-format
+msgid "%s (%s): Remove Tool"
+msgstr "%s (%s): Премахване на команда"
+
+#: lib/tools_dlg.tcl:193
+msgid "Remove Tool Commands"
+msgstr "Премахване на команди"
+
+#: lib/tools_dlg.tcl:198
+msgid "Remove"
+msgstr "Премахване"
+
+#: lib/tools_dlg.tcl:231
+msgid "(Blue denotes repository-local tools)"
+msgstr "(командите към локалното хранилище са обозначени в синьо)"
+
+#: lib/tools_dlg.tcl:283
+#, tcl-format
+msgid "%s (%s):"
+msgstr "%s (%s):"
+
+#: lib/tools_dlg.tcl:292
+#, tcl-format
+msgid "Run Command: %s"
+msgstr "Изпълнение на командата „%s“"
+
+#: lib/tools_dlg.tcl:306
+msgid "Arguments"
+msgstr "Аргументи"
+
+#: lib/tools_dlg.tcl:341
+msgid "OK"
+msgstr "Добре"
+
+#: lib/search.tcl:48
+msgid "Find:"
+msgstr "Търсене:"
+
+#: lib/search.tcl:50
+msgid "Next"
+msgstr "Следваща поява"
+
+#: lib/search.tcl:51
+msgid "Prev"
+msgstr "Предишна поява"
+
+#: lib/search.tcl:52
+msgid "RegExp"
+msgstr "РегИзр"
+
+#: lib/search.tcl:54
+msgid "Case"
+msgstr "Главни/Малки"
+
+#: lib/shortcut.tcl:8 lib/shortcut.tcl:43 lib/shortcut.tcl:75
+#, tcl-format
+msgid "%s (%s): Create Desktop Icon"
+msgstr "%s (%s): Добавяне на икона на работния плот"
+
+#: lib/shortcut.tcl:24 lib/shortcut.tcl:65
+msgid "Cannot write shortcut:"
+msgstr "Клавишната комбинация не може да се запази:"
+
+#: lib/shortcut.tcl:140
+msgid "Cannot write icon:"
+msgstr "Иконата не може да се запази:"
+
+#: lib/remote_branch_delete.tcl:29
+#, tcl-format
+msgid "%s (%s): Delete Branch Remotely"
+msgstr "%s (%s): Изтриване на отдалечения клон"
+
+#: lib/remote_branch_delete.tcl:34
+msgid "Delete Branch Remotely"
+msgstr "Изтриване на отдалечения клон"
+
+#: lib/remote_branch_delete.tcl:48
+msgid "From Repository"
+msgstr "От хранилище"
+
+#: lib/remote_branch_delete.tcl:88
+msgid "Branches"
+msgstr "Клони"
+
+#: lib/remote_branch_delete.tcl:110
+msgid "Delete Only If"
+msgstr "Изтриване, само ако"
+
+#: lib/remote_branch_delete.tcl:112
+msgid "Merged Into:"
+msgstr "Слят в:"
+
+#: lib/remote_branch_delete.tcl:120 lib/branch_delete.tcl:53
+msgid "Always (Do not perform merge checks)"
+msgstr "Винаги (без проверка за сливане)"
+
+#: lib/remote_branch_delete.tcl:153
+msgid "A branch is required for 'Merged Into'."
+msgstr "За данните „Слят в“ е необходимо да зададете клон."
+
+#: lib/remote_branch_delete.tcl:185
+#, tcl-format
+msgid ""
+"The following branches are not completely merged into %s:\n"
+"\n"
+" - %s"
+msgstr ""
+"Следните клони не са слети напълно в „%s“:\n"
+"\n"
+" ● %s"
+
+#: lib/remote_branch_delete.tcl:190
+#, tcl-format
+msgid ""
+"One or more of the merge tests failed because you have not fetched the "
+"necessary commits. Try fetching from %s first."
+msgstr ""
+"Поне една от пробите за сливане е неуспешна, защото не сте доставили всички "
+"необходими подавания. Пробвайте първо да доставите подаванията от „%s“."
+
+#: lib/remote_branch_delete.tcl:208
+msgid "Please select one or more branches to delete."
+msgstr "Изберете поне един клон за изтриване."
+
+#: lib/remote_branch_delete.tcl:218 lib/branch_delete.tcl:115
+msgid ""
+"Recovering deleted branches is difficult.\n"
+"\n"
+"Delete the selected branches?"
+msgstr ""
+"Възстановяването на изтрити клони може да е трудно.\n"
+"\n"
+"Сигурни ли сте, че искате да триете?"
+
+#: lib/remote_branch_delete.tcl:227
+#, tcl-format
+msgid "Deleting branches from %s"
+msgstr "Изтриване на клони от „%s“"
+
+#: lib/remote_branch_delete.tcl:300
+msgid "No repository selected."
+msgstr "Не е избрано хранилище."
+
+#: lib/remote_branch_delete.tcl:305
+#, tcl-format
+msgid "Scanning %s..."
+msgstr "Претърсване на „%s“…"
+
+#: lib/choose_repository.tcl:45
msgid "Git Gui"
msgstr "ГПИ на Git"
-#: lib/choose_repository.tcl:92 lib/choose_repository.tcl:412
+#: lib/choose_repository.tcl:104 lib/choose_repository.tcl:427
msgid "Create New Repository"
msgstr "Създаване на ново хранилище"
-#: lib/choose_repository.tcl:98
+#: lib/choose_repository.tcl:110
msgid "New..."
msgstr "Ново…"
-#: lib/choose_repository.tcl:105 lib/choose_repository.tcl:496
+#: lib/choose_repository.tcl:117 lib/choose_repository.tcl:511
msgid "Clone Existing Repository"
msgstr "Клониране на съществуващо хранилище"
-#: lib/choose_repository.tcl:116
+#: lib/choose_repository.tcl:128
msgid "Clone..."
msgstr "Клониране…"
-#: lib/choose_repository.tcl:123 lib/choose_repository.tcl:1064
+#: lib/choose_repository.tcl:135 lib/choose_repository.tcl:1105
msgid "Open Existing Repository"
msgstr "Отваряне на съществуващо хранилище"
-#: lib/choose_repository.tcl:129
+#: lib/choose_repository.tcl:141
msgid "Open..."
msgstr "Отваряне…"
-#: lib/choose_repository.tcl:142
+#: lib/choose_repository.tcl:154
msgid "Recent Repositories"
msgstr "Скоро ползвани"
-#: lib/choose_repository.tcl:148
+#: lib/choose_repository.tcl:164
msgid "Open Recent Repository:"
msgstr "Отваряне на хранилище ползвано наскоро:"
-#: lib/choose_repository.tcl:316 lib/choose_repository.tcl:323
-#: lib/choose_repository.tcl:330
+#: lib/choose_repository.tcl:331 lib/choose_repository.tcl:338
+#: lib/choose_repository.tcl:345
#, tcl-format
msgid "Failed to create repository %s:"
msgstr "Неуспешно създаване на хранилището „%s“:"
-#: lib/choose_repository.tcl:417
+#: lib/choose_repository.tcl:422 lib/branch_create.tcl:33
+msgid "Create"
+msgstr "Създаване"
+
+#: lib/choose_repository.tcl:432
msgid "Directory:"
msgstr "Директория:"
-#: lib/choose_repository.tcl:447 lib/choose_repository.tcl:573
-#: lib/choose_repository.tcl:1098
+#: lib/choose_repository.tcl:462 lib/choose_repository.tcl:588
+#: lib/choose_repository.tcl:1139
msgid "Git Repository"
msgstr "Хранилище на Git"
-#: lib/choose_repository.tcl:472
+#: lib/choose_repository.tcl:487
#, tcl-format
msgid "Directory %s already exists."
msgstr "Вече съществува директория „%s“."
-#: lib/choose_repository.tcl:476
+#: lib/choose_repository.tcl:491
#, tcl-format
msgid "File %s already exists."
msgstr "Вече съществува файл „%s“."
-#: lib/choose_repository.tcl:491
+#: lib/choose_repository.tcl:506
msgid "Clone"
msgstr "Клониране"
-#: lib/choose_repository.tcl:504
+#: lib/choose_repository.tcl:519
msgid "Source Location:"
msgstr "Адрес на източника:"
-#: lib/choose_repository.tcl:513
+#: lib/choose_repository.tcl:528
msgid "Target Directory:"
msgstr "Целева директория:"
-#: lib/choose_repository.tcl:523
+#: lib/choose_repository.tcl:538
msgid "Clone Type:"
msgstr "Вид клониране:"
-#: lib/choose_repository.tcl:528
+#: lib/choose_repository.tcl:543
msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
msgstr "Стандартно (бързо, частично споделяне на файлове, твърди връзки)"
-#: lib/choose_repository.tcl:533
+#: lib/choose_repository.tcl:548
msgid "Full Copy (Slower, Redundant Backup)"
msgstr "Пълно (бавно, пълноценно резервно копие)"
-#: lib/choose_repository.tcl:538
+#: lib/choose_repository.tcl:553
msgid "Shared (Fastest, Not Recommended, No Backup)"
msgstr "Споделено (най-бързо, не се препоръчва, не прави резервно копие)"
-#: lib/choose_repository.tcl:545
+#: lib/choose_repository.tcl:560
msgid "Recursively clone submodules too"
msgstr "Рекурсивно клониране и на подмодулите"
-#: lib/choose_repository.tcl:579 lib/choose_repository.tcl:626
-#: lib/choose_repository.tcl:772 lib/choose_repository.tcl:842
-#: lib/choose_repository.tcl:1104 lib/choose_repository.tcl:1112
+#: lib/choose_repository.tcl:594 lib/choose_repository.tcl:641
+#: lib/choose_repository.tcl:790 lib/choose_repository.tcl:864
+#: lib/choose_repository.tcl:1145 lib/choose_repository.tcl:1153
#, tcl-format
msgid "Not a Git repository: %s"
msgstr "Това не е хранилище на Git: %s"
-#: lib/choose_repository.tcl:615
+#: lib/choose_repository.tcl:630
msgid "Standard only available for local repository."
-msgstr "Само локални хранилища могат да се клонират стандартно"
+msgstr "Само локални хранилища може да се клонират стандартно"
-#: lib/choose_repository.tcl:619
+#: lib/choose_repository.tcl:634
msgid "Shared only available for local repository."
-msgstr "Само локални хранилища могат да се клонират споделено"
+msgstr "Само локални хранилища може да се клонират споделено"
-#: lib/choose_repository.tcl:640
+#: lib/choose_repository.tcl:655
#, tcl-format
msgid "Location %s already exists."
msgstr "Местоположението „%s“ вече съществува."
-#: lib/choose_repository.tcl:651
+#: lib/choose_repository.tcl:666
msgid "Failed to configure origin"
msgstr "Неуспешно настройване на хранилището-източник"
-#: lib/choose_repository.tcl:663
+#: lib/choose_repository.tcl:678
msgid "Counting objects"
msgstr "Преброяване на обекти"
-#: lib/choose_repository.tcl:664
+#: lib/choose_repository.tcl:679
msgid "buckets"
msgstr "клетки"
-#: lib/choose_repository.tcl:688
+#: lib/choose_repository.tcl:703
#, tcl-format
msgid "Unable to copy objects/info/alternates: %s"
-msgstr "Обектите/информацията/синонимите не могат да бъдат копирани: %s"
+msgstr "Обектите/Информацията/Синонимите не може да се копират: %s"
-#: lib/choose_repository.tcl:724
+#: lib/choose_repository.tcl:740
#, tcl-format
msgid "Nothing to clone from %s."
msgstr "Няма какво да се клонира от „%s“."
-#: lib/choose_repository.tcl:726 lib/choose_repository.tcl:940
-#: lib/choose_repository.tcl:952
+#: lib/choose_repository.tcl:742 lib/choose_repository.tcl:962
+#: lib/choose_repository.tcl:974
msgid "The 'master' branch has not been initialized."
msgstr "Основният клон — „master“ не е инициализиран."
-#: lib/choose_repository.tcl:739
+#: lib/choose_repository.tcl:755
msgid "Hardlinks are unavailable. Falling back to copying."
msgstr "Не се поддържат твърди връзки. Преминава се към копиране."
-#: lib/choose_repository.tcl:751
+#: lib/choose_repository.tcl:769
#, tcl-format
msgid "Cloning from %s"
msgstr "Клониране на „%s“"
-#: lib/choose_repository.tcl:782
+#: lib/choose_repository.tcl:800
msgid "Copying objects"
msgstr "Копиране на обекти"
-#: lib/choose_repository.tcl:783
+#: lib/choose_repository.tcl:801
msgid "KiB"
msgstr "KiB"
-#: lib/choose_repository.tcl:807
+#: lib/choose_repository.tcl:825
#, tcl-format
msgid "Unable to copy object: %s"
msgstr "Неуспешно копиране на обект: %s"
-#: lib/choose_repository.tcl:817
+#: lib/choose_repository.tcl:837
msgid "Linking objects"
msgstr "Създаване на връзки към обектите"
-#: lib/choose_repository.tcl:818
+#: lib/choose_repository.tcl:838
msgid "objects"
msgstr "обекти"
-#: lib/choose_repository.tcl:826
+#: lib/choose_repository.tcl:846
#, tcl-format
msgid "Unable to hardlink object: %s"
msgstr "Неуспешно създаване на твърда връзка към обект: %s"
-#: lib/choose_repository.tcl:881
+#: lib/choose_repository.tcl:903
msgid "Cannot fetch branches and objects. See console output for details."
msgstr ""
-"Клоните и обектите не могат да бъдат изтеглени. За повече информация "
-"погледнете изхода на конзолата."
+"Клоните и обектите не може да се изтеглят. За повече информация погледнете "
+"изхода на конзолата."
-#: lib/choose_repository.tcl:892
+#: lib/choose_repository.tcl:914
msgid "Cannot fetch tags. See console output for details."
msgstr ""
-"Етикетите не могат да бъдат изтеглени. За повече информация погледнете "
-"изхода на конзолата."
+"Етикетите не може да се изтеглят. За повече информация погледнете изхода на "
+"конзолата."
-#: lib/choose_repository.tcl:916
+#: lib/choose_repository.tcl:938
msgid "Cannot determine HEAD. See console output for details."
msgstr ""
-"Върхът „HEAD“ не може да бъде определен. За повече информация погледнете "
-"изхода на конзолата."
+"Върхът „HEAD“ не може да се определи. За повече информация погледнете изхода "
+"на конзолата."
-#: lib/choose_repository.tcl:925
+#: lib/choose_repository.tcl:947
#, tcl-format
msgid "Unable to cleanup %s"
-msgstr "„%s“ не може да се зачисти"
+msgstr "„%s“ не може да се изчисти"
-#: lib/choose_repository.tcl:931
+#: lib/choose_repository.tcl:953
msgid "Clone failed."
msgstr "Неуспешно клониране."
-#: lib/choose_repository.tcl:938
+#: lib/choose_repository.tcl:960
msgid "No default branch obtained."
msgstr "Не е получен клон по подразбиране."
-#: lib/choose_repository.tcl:949
+#: lib/choose_repository.tcl:971
#, tcl-format
msgid "Cannot resolve %s as a commit."
msgstr "Няма подаване отговарящо на „%s“."
-#: lib/choose_repository.tcl:961
+#: lib/choose_repository.tcl:998
msgid "Creating working directory"
msgstr "Създаване на работната директория"
-#: lib/choose_repository.tcl:962 lib/index.tcl:70 lib/index.tcl:136
-#: lib/index.tcl:207
-msgid "files"
-msgstr "файлове"
-
-#: lib/choose_repository.tcl:981
-msgid "Cannot clone submodules."
-msgstr "Подмодулите не могат да се клонират."
+#: lib/choose_repository.tcl:1028
+msgid "Initial file checkout failed."
+msgstr "Неуспешно първоначално изтегляне."
-#: lib/choose_repository.tcl:990
+#: lib/choose_repository.tcl:1072
msgid "Cloning submodules"
msgstr "Клониране на подмодули"
-#: lib/choose_repository.tcl:1015
-msgid "Initial file checkout failed."
-msgstr "Неуспешно първоначално изтегляне."
-
-#: lib/choose_repository.tcl:1059
-msgid "Open"
-msgstr "Отваряне"
+#: lib/choose_repository.tcl:1087
+msgid "Cannot clone submodules."
+msgstr "Подмодулите не може да се клонират."
-#: lib/choose_repository.tcl:1069
+#: lib/choose_repository.tcl:1110
msgid "Repository:"
msgstr "Хранилище:"
-#: lib/choose_repository.tcl:1118
+#: lib/choose_repository.tcl:1159
#, tcl-format
msgid "Failed to open repository %s:"
msgstr "Неуспешно отваряне на хранилището „%s“:"
+#: lib/about.tcl:26
+msgid "git-gui - a graphical user interface for Git."
+msgstr "git-gui — графичен интерфейс за Git."
+
+#: lib/blame.tcl:74
+#, tcl-format
+msgid "%s (%s): File Viewer"
+msgstr "%s (%s): Преглед на файлове"
+
+#: lib/blame.tcl:80
+msgid "Commit:"
+msgstr "Подаване:"
+
+#: lib/blame.tcl:282
+msgid "Copy Commit"
+msgstr "Копиране на подаване"
+
+#: lib/blame.tcl:286
+msgid "Find Text..."
+msgstr "Търсене на текст…"
+
+#: lib/blame.tcl:290
+msgid "Goto Line..."
+msgstr "Към ред…"
+
+#: lib/blame.tcl:299
+msgid "Do Full Copy Detection"
+msgstr "Пълно търсене на копиране"
+
+#: lib/blame.tcl:303
+msgid "Show History Context"
+msgstr "Показване на контекста от историята"
+
+#: lib/blame.tcl:306
+msgid "Blame Parent Commit"
+msgstr "Анотиране на родителското подаване"
+
+#: lib/blame.tcl:468
+#, tcl-format
+msgid "Reading %s..."
+msgstr "Чете се „%s“…"
+
+#: lib/blame.tcl:596
+msgid "Loading copy/move tracking annotations..."
+msgstr "Зареждане на анотациите за проследяване на копирането/преместването…"
+
+#: lib/blame.tcl:613
+msgid "lines annotated"
+msgstr "реда анотирани"
+
+#: lib/blame.tcl:815
+msgid "Loading original location annotations..."
+msgstr "Зареждане на анотациите за първоначалното местоположение…"
+
+#: lib/blame.tcl:818
+msgid "Annotation complete."
+msgstr "Анотирането завърши."
+
+#: lib/blame.tcl:849
+msgid "Busy"
+msgstr "Операцията не е завършила"
+
+#: lib/blame.tcl:850
+msgid "Annotation process is already running."
+msgstr "В момента тече процес на анотиране."
+
+#: lib/blame.tcl:889
+msgid "Running thorough copy detection..."
+msgstr "Изпълнява се цялостен процес на откриване на копиране…"
+
+#: lib/blame.tcl:957
+msgid "Loading annotation..."
+msgstr "Зареждане на анотации…"
+
+#: lib/blame.tcl:1010
+msgid "Author:"
+msgstr "Автор:"
+
+#: lib/blame.tcl:1014
+msgid "Committer:"
+msgstr "Подал:"
+
+#: lib/blame.tcl:1019
+msgid "Original File:"
+msgstr "Първоначален файл:"
+
+#: lib/blame.tcl:1067
+msgid "Cannot find HEAD commit:"
+msgstr "Подаването за връх „HEAD“ не може да се открие:"
+
+#: lib/blame.tcl:1122
+msgid "Cannot find parent commit:"
+msgstr "Родителското подаване не може да се открие"
+
+#: lib/blame.tcl:1137
+msgid "Unable to display parent"
+msgstr "Родителят не може да се покаже"
+
+#: lib/blame.tcl:1138 lib/diff.tcl:345
+msgid "Error loading diff:"
+msgstr "Грешка при зареждане на разлика:"
+
+#: lib/blame.tcl:1279
+msgid "Originally By:"
+msgstr "Първоначално от:"
+
+#: lib/blame.tcl:1285
+msgid "In File:"
+msgstr "Във файл:"
+
+#: lib/blame.tcl:1290
+msgid "Copied Or Moved Here By:"
+msgstr "Копирано или преместено тук от:"
+
+#: lib/diff.tcl:77
+#, tcl-format
+msgid ""
+"No differences detected.\n"
+"\n"
+"%s has no changes.\n"
+"\n"
+"The modification date of this file was updated by another application, but "
+"the content within the file was not changed.\n"
+"\n"
+"A rescan will be automatically started to find other files which may have "
+"the same state."
+msgstr ""
+"Не са открити разлики.\n"
+"\n"
+"Няма промени в „%s“.\n"
+"\n"
+"Времето на промяна на файла е бил зададен от друга програма, но съдържанието "
+"му не е променено.\n"
+"\n"
+"Автоматично ще започне нова проверка дали няма други файлове в това "
+"състояние."
+
+#: lib/diff.tcl:117
+#, tcl-format
+msgid "Loading diff of %s..."
+msgstr "Зареждане на разликите в „%s“…"
+
+#: lib/diff.tcl:143
+msgid ""
+"LOCAL: deleted\n"
+"REMOTE:\n"
+msgstr ""
+"ЛОКАЛНО: изтрит\n"
+"ОТДАЛЕЧЕНО:\n"
+
+#: lib/diff.tcl:148
+msgid ""
+"REMOTE: deleted\n"
+"LOCAL:\n"
+msgstr ""
+"ОТДАЛЕЧЕНО: изтрит\n"
+"ЛОКАЛНО:\n"
+
+#: lib/diff.tcl:155
+msgid "LOCAL:\n"
+msgstr "ЛОКАЛНО:\n"
+
+#: lib/diff.tcl:158
+msgid "REMOTE:\n"
+msgstr "ОТДАЛЕЧЕНО:\n"
+
+#: lib/diff.tcl:220 lib/diff.tcl:344
+#, tcl-format
+msgid "Unable to display %s"
+msgstr "Файлът „%s“ не може да се покаже"
+
+#: lib/diff.tcl:221
+msgid "Error loading file:"
+msgstr "Грешка при зареждане на файл:"
+
+#: lib/diff.tcl:227
+msgid "Git Repository (subproject)"
+msgstr "Хранилище на Git (подмодул)"
+
+#: lib/diff.tcl:239
+msgid "* Binary file (not showing content)."
+msgstr "● Двоичен файл (съдържанието не се показва)."
+
+#: lib/diff.tcl:244
+#, tcl-format
+msgid ""
+"* Untracked file is %d bytes.\n"
+"* Showing only first %d bytes.\n"
+msgstr ""
+"● Неследеният файл е %d байта.\n"
+"● Показват се само първите %d байта.\n"
+
+#: lib/diff.tcl:250
+#, tcl-format
+msgid ""
+"\n"
+"* Untracked file clipped here by %s.\n"
+"* To see the entire file, use an external editor.\n"
+msgstr ""
+"\n"
+"● Неследеният файл е отрязан дотук от програмата „%s“.\n"
+"● Използвайте външен редактор, за да видите целия файл.\n"
+
+#: lib/diff.tcl:583
+msgid "Failed to unstage selected hunk."
+msgstr "Избраното парче не може да се извади от индекса."
+
+#: lib/diff.tcl:591
+msgid "Failed to revert selected hunk."
+msgstr "Избраното парче не може да се върне."
+
+#: lib/diff.tcl:594
+msgid "Failed to stage selected hunk."
+msgstr "Избраното парче не може да се добави към индекса."
+
+#: lib/diff.tcl:687
+msgid "Failed to unstage selected line."
+msgstr "Избраният ред не може да се извади от индекса."
+
+#: lib/diff.tcl:696
+msgid "Failed to revert selected line."
+msgstr "Избраният ред не може да се върне."
+
+#: lib/diff.tcl:700
+msgid "Failed to stage selected line."
+msgstr "Избраният ред не може да се добави към индекса."
+
+#: lib/diff.tcl:889
+msgid "Failed to undo last revert."
+msgstr "Неуспешна отмяна на последното връщане."
+
+#: lib/sshkey.tcl:34
+msgid "No keys found."
+msgstr "Не са открити ключове."
+
+#: lib/sshkey.tcl:37
+#, tcl-format
+msgid "Found a public key in: %s"
+msgstr "Открит е публичен ключ в „%s“"
+
+#: lib/sshkey.tcl:43
+msgid "Generate Key"
+msgstr "Генериране на ключ"
+
+#: lib/sshkey.tcl:61
+msgid "Copy To Clipboard"
+msgstr "Копиране към системния буфер"
+
+#: lib/sshkey.tcl:75
+msgid "Your OpenSSH Public Key"
+msgstr "Публичният ви ключ за OpenSSH"
+
+#: lib/sshkey.tcl:83
+msgid "Generating..."
+msgstr "Генериране…"
+
+#: lib/sshkey.tcl:89
+#, tcl-format
+msgid ""
+"Could not start ssh-keygen:\n"
+"\n"
+"%s"
+msgstr ""
+"Програмата „ssh-keygen“ не може да се стартира:\n"
+"\n"
+"%s"
+
+#: lib/sshkey.tcl:116
+msgid "Generation failed."
+msgstr "Неуспешно генериране."
+
+#: lib/sshkey.tcl:123
+msgid "Generation succeeded, but no keys found."
+msgstr "Генерирането завърши успешно, а не са намерени ключове."
+
+#: lib/sshkey.tcl:126
+#, tcl-format
+msgid "Your key is in: %s"
+msgstr "Ключът ви е в „%s“"
+
+#: lib/branch_create.tcl:23
+#, tcl-format
+msgid "%s (%s): Create Branch"
+msgstr "%s (%s): Създаване на клон"
+
+#: lib/branch_create.tcl:28
+msgid "Create New Branch"
+msgstr "Създаване на нов клон"
+
+#: lib/branch_create.tcl:42
+msgid "Branch Name"
+msgstr "Име на клона"
+
+#: lib/branch_create.tcl:57
+msgid "Match Tracking Branch Name"
+msgstr "Съвпадане по името на следения клон"
+
+#: lib/branch_create.tcl:66
+msgid "Starting Revision"
+msgstr "Начална версия"
+
+#: lib/branch_create.tcl:72
+msgid "Update Existing Branch:"
+msgstr "Обновяване на съществуващ клон:"
+
+#: lib/branch_create.tcl:75
+msgid "No"
+msgstr "Не"
+
+#: lib/branch_create.tcl:80
+msgid "Fast Forward Only"
+msgstr "Само тривиално превъртащо сливане"
+
+#: lib/branch_create.tcl:97
+msgid "Checkout After Creation"
+msgstr "Преминаване към клона след създаването му"
+
+#: lib/branch_create.tcl:132
+msgid "Please select a tracking branch."
+msgstr "Изберете клон за следени."
+
+#: lib/branch_create.tcl:141
+#, tcl-format
+msgid "Tracking branch %s is not a branch in the remote repository."
+msgstr "Следящият клон — „%s“, не съществува в отдалеченото хранилище."
+
+#: lib/console.tcl:59
+msgid "Working... please wait..."
+msgstr "В момента се извършва действие, изчакайте…"
+
+#: lib/console.tcl:186
+msgid "Success"
+msgstr "Успех"
+
+#: lib/console.tcl:200
+msgid "Error: Command Failed"
+msgstr "Грешка: неуспешно изпълнение на команда"
+
+#: lib/line.tcl:17
+msgid "Goto Line:"
+msgstr "Към ред:"
+
+#: lib/line.tcl:23
+msgid "Go"
+msgstr "Към"
+
#: lib/choose_rev.tcl:52
msgid "This Detached Checkout"
msgstr "Това несвързано изтегляне"
@@ -1422,24 +2426,24 @@ msgstr ""
"В момента все още не сте завършили операция по сливане. Не може да поправите "
"предишното подаване, освен ако първо не преустановите текущото сливане.\n"
-#: lib/commit.tcl:48
+#: lib/commit.tcl:56
msgid "Error loading commit data for amend:"
msgstr "Грешка при зареждане на данните от подаване, които да се поправят:"
-#: lib/commit.tcl:75
+#: lib/commit.tcl:83
msgid "Unable to obtain your identity:"
-msgstr "Идентификацията ви не може да бъде определена:"
+msgstr "Идентификацията ви не може да се определи:"
-#: lib/commit.tcl:80
+#: lib/commit.tcl:88
msgid "Invalid GIT_COMMITTER_IDENT:"
msgstr "Неправилно поле „GIT_COMMITTER_IDENT“:"
-#: lib/commit.tcl:129
+#: lib/commit.tcl:138
#, tcl-format
msgid "warning: Tcl does not support encoding '%s'."
msgstr "предупреждение: Tcl не поддържа кодирането „%s“."
-#: lib/commit.tcl:149
+#: lib/commit.tcl:158
msgid ""
"Last scanned state does not match repository state.\n"
"\n"
@@ -1452,11 +2456,11 @@ msgstr ""
"хранилището.\n"
"\n"
"Някой друг процес за Git е променил хранилището междувременно. Състоянието "
-"трябва да бъде проверено преди ново подаване.\n"
+"трябва да се провери преди ново подаване.\n"
"\n"
"Автоматично ще започне нова проверка.\n"
-#: lib/commit.tcl:173
+#: lib/commit.tcl:182
#, tcl-format
msgid ""
"Unmerged files cannot be committed.\n"
@@ -1464,12 +2468,12 @@ msgid ""
"File %s has merge conflicts. You must resolve them and stage the file "
"before committing.\n"
msgstr ""
-"Неслетите файлове не могат да бъдат подавани.\n"
+"Неслетите файлове не може да се подадат.\n"
"\n"
"Във файла „%s“ има конфликти при сливане. За да го подадете, трябва първо да "
"коригирате конфликтите и да добавите файла към индекса за подаване.\n"
-#: lib/commit.tcl:181
+#: lib/commit.tcl:190
#, tcl-format
msgid ""
"Unknown file state %s detected.\n"
@@ -1478,9 +2482,9 @@ msgid ""
msgstr ""
"Непознато състояние на файл „%s“.\n"
"\n"
-"Файлът „%s“ не може да бъде подаден чрез текущата програма.\n"
+"Файлът „%s“ не може да се подаде чрез текущата програма.\n"
-#: lib/commit.tcl:189
+#: lib/commit.tcl:198
msgid ""
"No changes to commit.\n"
"\n"
@@ -1490,7 +2494,7 @@ msgstr ""
"\n"
"Трябва да добавите поне един файл към индекса, за да подадете.\n"
-#: lib/commit.tcl:204
+#: lib/commit.tcl:213
msgid ""
"Please supply a commit message.\n"
"\n"
@@ -1508,15 +2512,15 @@ msgstr ""
"● Втори ред: празен.\n"
"● Останалите редове: опишете защо се налага тази промяна.\n"
-#: lib/commit.tcl:235
+#: lib/commit.tcl:244
msgid "Calling pre-commit hook..."
msgstr "Изпълняване на куката преди подаване…"
-#: lib/commit.tcl:250
+#: lib/commit.tcl:259
msgid "Commit declined by pre-commit hook."
msgstr "Подаването е отхвърлено от куката преди подаване."
-#: lib/commit.tcl:269
+#: lib/commit.tcl:278
msgid ""
"You are about to commit on a detached head. This is a potentially dangerous "
"thing to do because if you switch to another branch you will lose your "
@@ -1532,32 +2536,32 @@ msgstr ""
" \n"
"Сигурни ли сте, че искате да извършите текущото подаване?"
-#: lib/commit.tcl:290
+#: lib/commit.tcl:299
msgid "Calling commit-msg hook..."
msgstr "Изпълняване на куката за съобщението при подаване…"
-#: lib/commit.tcl:305
+#: lib/commit.tcl:314
msgid "Commit declined by commit-msg hook."
msgstr "Подаването е отхвърлено от куката за съобщението при подаване."
-#: lib/commit.tcl:318
+#: lib/commit.tcl:327
msgid "Committing changes..."
msgstr "Подаване на промените…"
-#: lib/commit.tcl:334
+#: lib/commit.tcl:344
msgid "write-tree failed:"
msgstr "неуспешно запазване на дървото (write-tree):"
-#: lib/commit.tcl:335 lib/commit.tcl:382 lib/commit.tcl:403
+#: lib/commit.tcl:345 lib/commit.tcl:395 lib/commit.tcl:422
msgid "Commit failed."
msgstr "Неуспешно подаване."
-#: lib/commit.tcl:352
+#: lib/commit.tcl:362
#, tcl-format
msgid "Commit %s appears to be corrupt"
msgstr "Подаването „%s“ изглежда повредено"
-#: lib/commit.tcl:357
+#: lib/commit.tcl:367
msgid ""
"No changes to commit.\n"
"\n"
@@ -1572,34 +2576,63 @@ msgstr ""
"\n"
"Автоматично ще започне нова проверка.\n"
-#: lib/commit.tcl:364
+#: lib/commit.tcl:374
msgid "No changes to commit."
msgstr "Няма промени за подаване."
-#: lib/commit.tcl:381
+#: lib/commit.tcl:394
msgid "commit-tree failed:"
msgstr "неуспешно подаване на дървото (commit-tree):"
-#: lib/commit.tcl:402
+#: lib/commit.tcl:421
msgid "update-ref failed:"
msgstr "неуспешно обновяване на указателите (update-ref):"
-#: lib/commit.tcl:495
+#: lib/commit.tcl:514
#, tcl-format
msgid "Created commit %s: %s"
msgstr "Успешно подаване %s: %s"
-#: lib/console.tcl:59
-msgid "Working... please wait..."
-msgstr "В момента се извършва действие, изчакайте…"
+#: lib/branch_delete.tcl:16
+#, tcl-format
+msgid "%s (%s): Delete Branch"
+msgstr "%s (%s): Изтриване на клон"
-#: lib/console.tcl:186
-msgid "Success"
-msgstr "Успех"
+#: lib/branch_delete.tcl:21
+msgid "Delete Local Branch"
+msgstr "Изтриване на локален клон"
-#: lib/console.tcl:200
-msgid "Error: Command Failed"
-msgstr "Грешка: неуспешно изпълнение на команда"
+#: lib/branch_delete.tcl:39
+msgid "Local Branches"
+msgstr "Локални клони"
+
+#: lib/branch_delete.tcl:51
+msgid "Delete Only If Merged Into"
+msgstr "Изтриване, само ако промените са слети и другаде"
+
+#: lib/branch_delete.tcl:103
+#, tcl-format
+msgid "The following branches are not completely merged into %s:"
+msgstr "Не всички промени в клоните са слети в „%s“:"
+
+#: lib/branch_delete.tcl:131
+#, tcl-format
+msgid " - %s:"
+msgstr " — „%s:“"
+
+#: lib/branch_delete.tcl:141
+#, tcl-format
+msgid ""
+"Failed to delete branches:\n"
+"%s"
+msgstr ""
+"Неуспешно триене на клони:\n"
+"%s"
+
+#: lib/date.tcl:25
+#, tcl-format
+msgid "Invalid date from Git: %s"
+msgstr "Неправилни данни от Git: %s"
#: lib/database.tcl:42
msgid "Number of loose objects"
@@ -1629,12 +2662,6 @@ msgstr "Пакетирани обекти за окастряне"
msgid "Garbage files"
msgstr "Файлове за боклука"
-#: lib/database.tcl:57 lib/option.tcl:182 lib/option.tcl:197 lib/option.tcl:220
-#: lib/option.tcl:282
-#, tcl-format
-msgid "%s:"
-msgstr "%s:"
-
#: lib/database.tcl:66
#, tcl-format
msgid "%s (%s): Database Statistics"
@@ -1665,129 +2692,6 @@ msgstr ""
"\n"
"Да се започне ли компресирането?"
-#: lib/date.tcl:25
-#, tcl-format
-msgid "Invalid date from Git: %s"
-msgstr "Неправилни данни от Git: %s"
-
-#: lib/diff.tcl:77
-#, tcl-format
-msgid ""
-"No differences detected.\n"
-"\n"
-"%s has no changes.\n"
-"\n"
-"The modification date of this file was updated by another application, but "
-"the content within the file was not changed.\n"
-"\n"
-"A rescan will be automatically started to find other files which may have "
-"the same state."
-msgstr ""
-"Не са открити разлики.\n"
-"\n"
-"Няма промени в „%s“.\n"
-"\n"
-"Времето на промяна на файла е бил зададен от друга програма, но съдържанието "
-"му не е променено.\n"
-"\n"
-"Автоматично ще започне нова проверка дали няма други файлове в това "
-"състояние."
-
-#: lib/diff.tcl:117
-#, tcl-format
-msgid "Loading diff of %s..."
-msgstr "Зареждане на разликите в „%s“…"
-
-#: lib/diff.tcl:143
-msgid ""
-"LOCAL: deleted\n"
-"REMOTE:\n"
-msgstr ""
-"ЛОКАЛНО: изтрит\n"
-"ОТДАЛЕЧЕНО:\n"
-
-#: lib/diff.tcl:148
-msgid ""
-"REMOTE: deleted\n"
-"LOCAL:\n"
-msgstr ""
-"ОТДАЛЕЧЕНО: изтрит\n"
-"ЛОКАЛНО:\n"
-
-#: lib/diff.tcl:155
-msgid "LOCAL:\n"
-msgstr "ЛОКАЛНО:\n"
-
-#: lib/diff.tcl:158
-msgid "REMOTE:\n"
-msgstr "ОТДАЛЕЧЕНО:\n"
-
-#: lib/diff.tcl:220 lib/diff.tcl:357
-#, tcl-format
-msgid "Unable to display %s"
-msgstr "Файлът „%s“ не може да бъде показан"
-
-#: lib/diff.tcl:221
-msgid "Error loading file:"
-msgstr "Грешка при зареждане на файл:"
-
-#: lib/diff.tcl:227
-msgid "Git Repository (subproject)"
-msgstr "Хранилище на Git (подмодул)"
-
-#: lib/diff.tcl:239
-msgid "* Binary file (not showing content)."
-msgstr "● Двоичен файл (съдържанието не се показва)."
-
-#: lib/diff.tcl:244
-#, tcl-format
-msgid ""
-"* Untracked file is %d bytes.\n"
-"* Showing only first %d bytes.\n"
-msgstr ""
-"● Неследеният файл е %d байта.\n"
-"● Показват се само първите %d байта.\n"
-
-#: lib/diff.tcl:250
-#, tcl-format
-msgid ""
-"\n"
-"* Untracked file clipped here by %s.\n"
-"* To see the entire file, use an external editor.\n"
-msgstr ""
-"\n"
-"● Неследеният файл е отрязан дотук от програмата „%s“.\n"
-"● Използвайте външен редактор, за да видите целия файл.\n"
-
-#: lib/diff.tcl:580
-msgid "Failed to unstage selected hunk."
-msgstr "Избраното парче не може да бъде извадено от индекса."
-
-#: lib/diff.tcl:587
-msgid "Failed to stage selected hunk."
-msgstr "Избраното парче не може да бъде добавено към индекса."
-
-#: lib/diff.tcl:666
-msgid "Failed to unstage selected line."
-msgstr "Избраният ред не може да бъде изваден от индекса."
-
-#: lib/diff.tcl:674
-msgid "Failed to stage selected line."
-msgstr "Избраният ред не може да бъде добавен към индекса."
-
-#: lib/encoding.tcl:443
-msgid "Default"
-msgstr "Стандартното"
-
-#: lib/encoding.tcl:448
-#, tcl-format
-msgid "System (%s)"
-msgstr "Системното (%s)"
-
-#: lib/encoding.tcl:459 lib/encoding.tcl:465
-msgid "Other"
-msgstr "Друго"
-
#: lib/error.tcl:20
#, tcl-format
msgid "%s: error"
@@ -1812,98 +2716,6 @@ msgstr "Преди да можете да подадете, коригирайт
msgid "%s (%s): error"
msgstr "%s (%s): грешка"
-#: lib/index.tcl:6
-msgid "Unable to unlock the index."
-msgstr "Индексът не може да бъде отключен."
-
-#: lib/index.tcl:17
-msgid "Index Error"
-msgstr "Грешка в индекса"
-
-#: lib/index.tcl:19
-msgid ""
-"Updating the Git index failed. A rescan will be automatically started to "
-"resynchronize git-gui."
-msgstr ""
-"Неуспешно обновяване на индекса на Git. Автоматично ще започне нова проверка "
-"за синхронизирането на git-gui."
-
-#: lib/index.tcl:30
-msgid "Continue"
-msgstr "Продължаване"
-
-#: lib/index.tcl:33
-msgid "Unlock Index"
-msgstr "Отключване на индекса"
-
-#: lib/index.tcl:294
-msgid "Unstaging selected files from commit"
-msgstr "Изваждане на избраните файлове от подаването"
-
-#: lib/index.tcl:298
-#, tcl-format
-msgid "Unstaging %s from commit"
-msgstr "Изваждане на „%s“ от подаването"
-
-#: lib/index.tcl:337
-msgid "Ready to commit."
-msgstr "Готовност за подаване."
-
-#: lib/index.tcl:346
-msgid "Adding selected files"
-msgstr "Добавяне на избраните файлове"
-
-#: lib/index.tcl:350
-#, tcl-format
-msgid "Adding %s"
-msgstr "Добавяне на „%s“"
-
-#: lib/index.tcl:380
-#, tcl-format
-msgid "Stage %d untracked files?"
-msgstr "Да се добавят ли %d неследени файла към индекса?"
-
-#: lib/index.tcl:388
-msgid "Adding all changed files"
-msgstr "Добавяне на всички променени файлове"
-
-#: lib/index.tcl:428
-#, tcl-format
-msgid "Revert changes in file %s?"
-msgstr "Да се махнат ли промените във файла „%s“?"
-
-#: lib/index.tcl:430
-#, tcl-format
-msgid "Revert changes in these %i files?"
-msgstr "Да се махнат ли промените в тези %i файла?"
-
-#: lib/index.tcl:438
-msgid "Any unstaged changes will be permanently lost by the revert."
-msgstr ""
-"Всички промени, които не са били вкарани в индекса, ще бъдат безвъзвратно "
-"загубени."
-
-#: lib/index.tcl:441
-msgid "Do Nothing"
-msgstr "Нищо да не се прави"
-
-#: lib/index.tcl:459
-msgid "Reverting selected files"
-msgstr "Махане на промените в избраните файлове"
-
-#: lib/index.tcl:463
-#, tcl-format
-msgid "Reverting %s"
-msgstr "Махане на промените в „%s“"
-
-#: lib/line.tcl:17
-msgid "Goto Line:"
-msgstr "Към ред:"
-
-#: lib/line.tcl:23
-msgid "Go"
-msgstr "Придвижване"
-
#: lib/merge.tcl:13
msgid ""
"Cannot merge while amending.\n"
@@ -1927,7 +2739,7 @@ msgstr ""
"Последно установеното състояние не отговаря на това в хранилището.\n"
"\n"
"Някой друг процес за Git е променил хранилището междувременно. Състоянието "
-"трябва да бъде проверено, преди да се извърши сливане.\n"
+"трябва да се провери, преди да се извърши сливане.\n"
"\n"
"Автоматично ще започне нова проверка.\n"
"\n"
@@ -2005,7 +2817,7 @@ msgid ""
"\n"
"You must finish amending this commit.\n"
msgstr ""
-"Поправянето не може да бъде преустановено.\n"
+"Поправянето не може да се преустанови.\n"
"\n"
"Трябва да завършите поправката на това подаване.\n"
@@ -2019,7 +2831,7 @@ msgid ""
msgstr ""
"Да се преустанови ли сливането?\n"
"\n"
-"В такъв случай ●ВСИЧКИ● неподадени промени ще бъдат безвъзвратно загубени.\n"
+"В такъв случай ●ВСИЧКИ● неподадени промени ще се загубят безвъзвратно.\n"
"\n"
"Наистина ли да се преустанови сливането?"
@@ -2033,775 +2845,22 @@ msgid ""
msgstr ""
"Да се занулят ли промените?\n"
"\n"
-"В такъв случай ●ВСИЧКИ● неподадени промени ще бъдат безвъзвратно загубени.\n"
+"В такъв случай ●ВСИЧКИ● неподадени промени ще се загубят безвъзвратно.\n"
"\n"
"Наистина ли да се занулят промените?"
-#: lib/merge.tcl:245
+#: lib/merge.tcl:246
msgid "Aborting"
msgstr "Преустановяване"
-#: lib/merge.tcl:245
+#: lib/merge.tcl:247
msgid "files reset"
msgstr "файла със занулени промени"
-#: lib/merge.tcl:273
+#: lib/merge.tcl:277
msgid "Abort failed."
msgstr "Неуспешно преустановяване."
-#: lib/merge.tcl:275
+#: lib/merge.tcl:279
msgid "Abort completed. Ready."
msgstr "Успешно преустановяване. Готовност за следващо действие."
-
-#: lib/mergetool.tcl:8
-msgid "Force resolution to the base version?"
-msgstr "Да се използва базовата версия"
-
-#: lib/mergetool.tcl:9
-msgid "Force resolution to this branch?"
-msgstr "Да се използва версията от този клон"
-
-#: lib/mergetool.tcl:10
-msgid "Force resolution to the other branch?"
-msgstr "Да се използва версията от другия клон"
-
-#: lib/mergetool.tcl:14
-#, tcl-format
-msgid ""
-"Note that the diff shows only conflicting changes.\n"
-"\n"
-"%s will be overwritten.\n"
-"\n"
-"This operation can be undone only by restarting the merge."
-msgstr ""
-"Разликата показва само разликите с конфликт.\n"
-"\n"
-"Файлът „%s“ ще бъде презаписан.\n"
-"\n"
-"Тази операция може да бъде отменена само чрез започване на сливането наново."
-
-#: lib/mergetool.tcl:45
-#, tcl-format
-msgid "File %s seems to have unresolved conflicts, still stage?"
-msgstr ""
-"Изглежда, че все още има некоригирани конфликти във файла „%s“. Да се добави "
-"ли файлът към индекса?"
-
-#: lib/mergetool.tcl:60
-#, tcl-format
-msgid "Adding resolution for %s"
-msgstr "Добавяне на корекция на конфликтите в „%s“"
-
-#: lib/mergetool.tcl:141
-msgid "Cannot resolve deletion or link conflicts using a tool"
-msgstr ""
-"Конфликтите при символни връзки или изтриване не могат да бъдат коригирани с "
-"външна програма."
-
-#: lib/mergetool.tcl:146
-msgid "Conflict file does not exist"
-msgstr "Файлът, в който е конфликтът, не съществува"
-
-#: lib/mergetool.tcl:246
-#, tcl-format
-msgid "Not a GUI merge tool: '%s'"
-msgstr "Това не е графична програма за сливане: „%s“"
-
-#: lib/mergetool.tcl:275
-#, tcl-format
-msgid "Unsupported merge tool '%s'"
-msgstr "Неподдържана програма за сливане: „%s“"
-
-#: lib/mergetool.tcl:310
-msgid "Merge tool is already running, terminate it?"
-msgstr "Програмата за сливане вече е стартирана. Да бъде ли изключена?"
-
-#: lib/mergetool.tcl:330
-#, tcl-format
-msgid ""
-"Error retrieving versions:\n"
-"%s"
-msgstr ""
-"Грешка при изтеглянето на версии:\n"
-"%s"
-
-#: lib/mergetool.tcl:350
-#, tcl-format
-msgid ""
-"Could not start the merge tool:\n"
-"\n"
-"%s"
-msgstr ""
-"Програмата за сливане не може да бъде стартирана:\n"
-"\n"
-"%s"
-
-#: lib/mergetool.tcl:354
-msgid "Running merge tool..."
-msgstr "Стартиране на програмата за сливане…"
-
-#: lib/mergetool.tcl:382 lib/mergetool.tcl:390
-msgid "Merge tool failed."
-msgstr "Грешка в програмата за сливане."
-
-#: lib/option.tcl:11
-#, tcl-format
-msgid "Invalid global encoding '%s'"
-msgstr "Неправилно глобално кодиране „%s“"
-
-#: lib/option.tcl:19
-#, tcl-format
-msgid "Invalid repo encoding '%s'"
-msgstr "Неправилно кодиране „%s“ на хранилището"
-
-#: lib/option.tcl:119
-msgid "Restore Defaults"
-msgstr "Стандартни настройки"
-
-#: lib/option.tcl:123
-msgid "Save"
-msgstr "Запазване"
-
-#: lib/option.tcl:133
-#, tcl-format
-msgid "%s Repository"
-msgstr "Хранилище „%s“"
-
-#: lib/option.tcl:134
-msgid "Global (All Repositories)"
-msgstr "Глобално (за всички хранилища)"
-
-#: lib/option.tcl:140
-msgid "User Name"
-msgstr "Потребителско име"
-
-#: lib/option.tcl:141
-msgid "Email Address"
-msgstr "Адрес на е-поща"
-
-#: lib/option.tcl:143
-msgid "Summarize Merge Commits"
-msgstr "Обобщаване на подаванията при сливане"
-
-#: lib/option.tcl:144
-msgid "Merge Verbosity"
-msgstr "Подробности при сливанията"
-
-#: lib/option.tcl:145
-msgid "Show Diffstat After Merge"
-msgstr "Извеждане на статистика след сливанията"
-
-#: lib/option.tcl:146
-msgid "Use Merge Tool"
-msgstr "Използване на програма за сливане"
-
-#: lib/option.tcl:148
-msgid "Trust File Modification Timestamps"
-msgstr "Доверие във времето на промяна на файловете"
-
-#: lib/option.tcl:149
-msgid "Prune Tracking Branches During Fetch"
-msgstr "Окастряне на следящите клонове при доставяне"
-
-#: lib/option.tcl:150
-msgid "Match Tracking Branches"
-msgstr "Напасване на следящите клонове"
-
-#: lib/option.tcl:151
-msgid "Use Textconv For Diffs and Blames"
-msgstr "Използване на „textconv“ за разликите и анотирането"
-
-#: lib/option.tcl:152
-msgid "Blame Copy Only On Changed Files"
-msgstr "Анотиране на копието само по променените файлове"
-
-#: lib/option.tcl:153
-msgid "Maximum Length of Recent Repositories List"
-msgstr "Максимален брой на списъка „Скоро ползвани“ хранилища"
-
-#: lib/option.tcl:154
-msgid "Minimum Letters To Blame Copy On"
-msgstr "Минимален брой знаци за анотиране на копието"
-
-#: lib/option.tcl:155
-msgid "Blame History Context Radius (days)"
-msgstr "Исторически обхват за анотиране в дни"
-
-#: lib/option.tcl:156
-msgid "Number of Diff Context Lines"
-msgstr "Брой редове за контекста на разликите"
-
-#: lib/option.tcl:157
-msgid "Additional Diff Parameters"
-msgstr "Аргументи към командата за разликите"
-
-#: lib/option.tcl:158
-msgid "Commit Message Text Width"
-msgstr "Широчина на текста на съобщението при подаване"
-
-#: lib/option.tcl:159
-msgid "New Branch Name Template"
-msgstr "Шаблон за името на новите клони"
-
-#: lib/option.tcl:160
-msgid "Default File Contents Encoding"
-msgstr "Кодиране на файловете"
-
-#: lib/option.tcl:161
-msgid "Warn before committing to a detached head"
-msgstr "Предупреждаване при подаване към несвързан указател"
-
-#: lib/option.tcl:162
-msgid "Staging of untracked files"
-msgstr "Добавяне на неследените файлове към индекса"
-
-#: lib/option.tcl:163
-msgid "Show untracked files"
-msgstr "Показване на неследените файлове"
-
-#: lib/option.tcl:164
-msgid "Tab spacing"
-msgstr "Ширина на табулацията"
-
-#: lib/option.tcl:210
-msgid "Change"
-msgstr "Смяна"
-
-#: lib/option.tcl:254
-msgid "Spelling Dictionary:"
-msgstr "Правописен речник:"
-
-#: lib/option.tcl:284
-msgid "Change Font"
-msgstr "Смяна на шрифта"
-
-#: lib/option.tcl:288
-#, tcl-format
-msgid "Choose %s"
-msgstr "Избор на „%s“"
-
-#: lib/option.tcl:294
-msgid "pt."
-msgstr "тчк."
-
-#: lib/option.tcl:308
-msgid "Preferences"
-msgstr "Настройки"
-
-#: lib/option.tcl:345
-msgid "Failed to completely save options:"
-msgstr "Неуспешно запазване на настройките:"
-
-#: lib/remote.tcl:200
-msgid "Push to"
-msgstr "Изтласкване към"
-
-#: lib/remote.tcl:218
-msgid "Remove Remote"
-msgstr "Премахване на отдалечено хранилище"
-
-#: lib/remote.tcl:223
-msgid "Prune from"
-msgstr "Окастряне от"
-
-#: lib/remote.tcl:228
-msgid "Fetch from"
-msgstr "Доставяне от"
-
-#: lib/remote.tcl:253 lib/remote.tcl:258
-msgid "All"
-msgstr "Всички"
-
-#: lib/remote_add.tcl:20
-#, tcl-format
-msgid "%s (%s): Add Remote"
-msgstr "%s (%s): Добавяне на отдалечено хранилище"
-
-#: lib/remote_add.tcl:25
-msgid "Add New Remote"
-msgstr "Добавяне на отдалечено хранилище"
-
-#: lib/remote_add.tcl:30 lib/tools_dlg.tcl:37
-msgid "Add"
-msgstr "Добавяне"
-
-#: lib/remote_add.tcl:39
-msgid "Remote Details"
-msgstr "Данни за отдалеченото хранилище"
-
-#: lib/remote_add.tcl:50
-msgid "Location:"
-msgstr "Местоположение:"
-
-#: lib/remote_add.tcl:60
-msgid "Further Action"
-msgstr "Следващо действие"
-
-#: lib/remote_add.tcl:63
-msgid "Fetch Immediately"
-msgstr "Незабавно доставяне"
-
-#: lib/remote_add.tcl:69
-msgid "Initialize Remote Repository and Push"
-msgstr "Инициализиране на отдалеченото хранилище и изтласкване на промените"
-
-#: lib/remote_add.tcl:75
-msgid "Do Nothing Else Now"
-msgstr "Да не се прави нищо"
-
-#: lib/remote_add.tcl:100
-msgid "Please supply a remote name."
-msgstr "Задайте име за отдалеченото хранилище."
-
-#: lib/remote_add.tcl:113
-#, tcl-format
-msgid "'%s' is not an acceptable remote name."
-msgstr "Отдалечено хранилище не може да се казва „%s“."
-
-#: lib/remote_add.tcl:124
-#, tcl-format
-msgid "Failed to add remote '%s' of location '%s'."
-msgstr "Неуспешно добавяне на отдалеченото хранилище „%s“ от адрес „%s“."
-
-#: lib/remote_add.tcl:132 lib/transport.tcl:6
-#, tcl-format
-msgid "fetch %s"
-msgstr "доставяне на „%s“"
-
-#: lib/remote_add.tcl:133
-#, tcl-format
-msgid "Fetching the %s"
-msgstr "Доставяне на „%s“"
-
-#: lib/remote_add.tcl:156
-#, tcl-format
-msgid "Do not know how to initialize repository at location '%s'."
-msgstr "Хранилището с местоположение „%s“ не може да бъде инициализирано."
-
-#: lib/remote_add.tcl:162 lib/transport.tcl:54 lib/transport.tcl:92
-#: lib/transport.tcl:110
-#, tcl-format
-msgid "push %s"
-msgstr "изтласкване на „%s“"
-
-#: lib/remote_add.tcl:163
-#, tcl-format
-msgid "Setting up the %s (at %s)"
-msgstr "Добавяне на хранилище „%s“ (с адрес „%s“)"
-
-#: lib/remote_branch_delete.tcl:29
-#, tcl-format
-msgid "%s (%s): Delete Branch Remotely"
-msgstr "%s (%s): Изтриване на отдалечения клон"
-
-#: lib/remote_branch_delete.tcl:34
-msgid "Delete Branch Remotely"
-msgstr "Изтриване на отдалечения клон"
-
-#: lib/remote_branch_delete.tcl:48
-msgid "From Repository"
-msgstr "От хранилище"
-
-#: lib/remote_branch_delete.tcl:51 lib/transport.tcl:165
-msgid "Remote:"
-msgstr "Отдалечено хранилище:"
-
-#: lib/remote_branch_delete.tcl:72 lib/transport.tcl:187
-msgid "Arbitrary Location:"
-msgstr "Произволно местоположение:"
-
-#: lib/remote_branch_delete.tcl:88
-msgid "Branches"
-msgstr "Клони"
-
-#: lib/remote_branch_delete.tcl:110
-msgid "Delete Only If"
-msgstr "Изтриване, само ако"
-
-#: lib/remote_branch_delete.tcl:112
-msgid "Merged Into:"
-msgstr "Слят в:"
-
-#: lib/remote_branch_delete.tcl:153
-msgid "A branch is required for 'Merged Into'."
-msgstr "За данните „Слят в“ е необходимо да зададете клон."
-
-#: lib/remote_branch_delete.tcl:185
-#, tcl-format
-msgid ""
-"The following branches are not completely merged into %s:\n"
-"\n"
-" - %s"
-msgstr ""
-"Следните клони не са слети напълно в „%s“:\n"
-"\n"
-" ● %s"
-
-#: lib/remote_branch_delete.tcl:190
-#, tcl-format
-msgid ""
-"One or more of the merge tests failed because you have not fetched the "
-"necessary commits. Try fetching from %s first."
-msgstr ""
-"Поне една от пробите за сливане е неуспешна, защото не сте доставили всички "
-"необходими подавания. Пробвайте първо да доставите подаванията от „%s“."
-
-#: lib/remote_branch_delete.tcl:208
-msgid "Please select one or more branches to delete."
-msgstr "Изберете поне един клон за изтриване."
-
-#: lib/remote_branch_delete.tcl:227
-#, tcl-format
-msgid "Deleting branches from %s"
-msgstr "Изтриване на клони от „%s“"
-
-#: lib/remote_branch_delete.tcl:300
-msgid "No repository selected."
-msgstr "Не е избрано хранилище."
-
-#: lib/remote_branch_delete.tcl:305
-#, tcl-format
-msgid "Scanning %s..."
-msgstr "Претърсване на „%s“…"
-
-#: lib/search.tcl:48
-msgid "Find:"
-msgstr "Търсене:"
-
-#: lib/search.tcl:50
-msgid "Next"
-msgstr "Следваща поява"
-
-#: lib/search.tcl:51
-msgid "Prev"
-msgstr "Предишна поява"
-
-#: lib/search.tcl:52
-msgid "RegExp"
-msgstr "РегИзр"
-
-#: lib/search.tcl:54
-msgid "Case"
-msgstr "Главни/малки"
-
-#: lib/shortcut.tcl:8 lib/shortcut.tcl:43 lib/shortcut.tcl:75
-#, tcl-format
-msgid "%s (%s): Create Desktop Icon"
-msgstr "%s (%s): Добавяне на икона на работния плот"
-
-#: lib/shortcut.tcl:24 lib/shortcut.tcl:65
-msgid "Cannot write shortcut:"
-msgstr "Клавишната комбинация не може да бъде запазена:"
-
-#: lib/shortcut.tcl:140
-msgid "Cannot write icon:"
-msgstr "Иконата не може да бъде запазена:"
-
-#: lib/spellcheck.tcl:57
-msgid "Unsupported spell checker"
-msgstr "Тази програма за проверка на правописа не се поддържа"
-
-#: lib/spellcheck.tcl:65
-msgid "Spell checking is unavailable"
-msgstr "Липсва програма за проверка на правописа"
-
-#: lib/spellcheck.tcl:68
-msgid "Invalid spell checking configuration"
-msgstr "Неправилни настройки на проверката на правописа"
-
-#: lib/spellcheck.tcl:70
-#, tcl-format
-msgid "Reverting dictionary to %s."
-msgstr "Ползване на речник за език „%s“."
-
-#: lib/spellcheck.tcl:73
-msgid "Spell checker silently failed on startup"
-msgstr "Програмата за правопис даже не стартира успешно."
-
-#: lib/spellcheck.tcl:80
-msgid "Unrecognized spell checker"
-msgstr "Непозната програма за проверка на правописа"
-
-#: lib/spellcheck.tcl:186
-msgid "No Suggestions"
-msgstr "Няма предложения"
-
-#: lib/spellcheck.tcl:388
-msgid "Unexpected EOF from spell checker"
-msgstr "Неочакван край на файл от програмата за проверка на правописа"
-
-#: lib/spellcheck.tcl:392
-msgid "Spell Checker Failed"
-msgstr "Грешка в програмата за проверка на правописа"
-
-#: lib/sshkey.tcl:31
-msgid "No keys found."
-msgstr "Не са открити ключове."
-
-#: lib/sshkey.tcl:34
-#, tcl-format
-msgid "Found a public key in: %s"
-msgstr "Открит е публичен ключ в „%s“"
-
-#: lib/sshkey.tcl:40
-msgid "Generate Key"
-msgstr "Генериране на ключ"
-
-#: lib/sshkey.tcl:58
-msgid "Copy To Clipboard"
-msgstr "Копиране към системния буфер"
-
-#: lib/sshkey.tcl:72
-msgid "Your OpenSSH Public Key"
-msgstr "Публичният ви ключ за OpenSSH"
-
-#: lib/sshkey.tcl:80
-msgid "Generating..."
-msgstr "Генериране…"
-
-#: lib/sshkey.tcl:86
-#, tcl-format
-msgid ""
-"Could not start ssh-keygen:\n"
-"\n"
-"%s"
-msgstr ""
-"Програмата „ssh-keygen“ не може да бъде стартирана:\n"
-"\n"
-"%s"
-
-#: lib/sshkey.tcl:113
-msgid "Generation failed."
-msgstr "Неуспешно генериране."
-
-#: lib/sshkey.tcl:120
-msgid "Generation succeeded, but no keys found."
-msgstr "Генерирането завърши успешно, а не са намерени ключове."
-
-#: lib/sshkey.tcl:123
-#, tcl-format
-msgid "Your key is in: %s"
-msgstr "Ключът ви е в „%s“"
-
-#: lib/status_bar.tcl:87
-#, tcl-format
-msgid "%s ... %*i of %*i %s (%3i%%)"
-msgstr "%s… %*i от общо %*i %s (%3i%%)"
-
-#: lib/tools.tcl:76
-#, tcl-format
-msgid "Running %s requires a selected file."
-msgstr "За изпълнението на „%s“ трябва да изберете файл."
-
-#: lib/tools.tcl:92
-#, tcl-format
-msgid "Are you sure you want to run %1$s on file \"%2$s\"?"
-msgstr "Сигурни ли сте, че искате да изпълните „%1$s“ върху файла „%2$s“?"
-
-#: lib/tools.tcl:96
-#, tcl-format
-msgid "Are you sure you want to run %s?"
-msgstr "Сигурни ли сте, че искате да изпълните „%s“?"
-
-#: lib/tools.tcl:118
-#, tcl-format
-msgid "Tool: %s"
-msgstr "Команда: %s"
-
-#: lib/tools.tcl:119
-#, tcl-format
-msgid "Running: %s"
-msgstr "Изпълнение: %s"
-
-#: lib/tools.tcl:158
-#, tcl-format
-msgid "Tool completed successfully: %s"
-msgstr "Командата завърши успешно: %s"
-
-#: lib/tools.tcl:160
-#, tcl-format
-msgid "Tool failed: %s"
-msgstr "Командата върна грешка: %s"
-
-#: lib/tools_dlg.tcl:22
-#, tcl-format
-msgid "%s (%s): Add Tool"
-msgstr "%s (%s): Добавяне на команда"
-
-#: lib/tools_dlg.tcl:28
-msgid "Add New Tool Command"
-msgstr "Добавяне на команда"
-
-#: lib/tools_dlg.tcl:34
-msgid "Add globally"
-msgstr "Глобално добавяне"
-
-#: lib/tools_dlg.tcl:46
-msgid "Tool Details"
-msgstr "Подробности за командата"
-
-#: lib/tools_dlg.tcl:49
-msgid "Use '/' separators to create a submenu tree:"
-msgstr "За създаване на подменюта използвайте знака „/“ за разделител:"
-
-#: lib/tools_dlg.tcl:60
-msgid "Command:"
-msgstr "Команда:"
-
-#: lib/tools_dlg.tcl:71
-msgid "Show a dialog before running"
-msgstr "Преди изпълнение да се извежда диалогов прозорец"
-
-#: lib/tools_dlg.tcl:77
-msgid "Ask the user to select a revision (sets $REVISION)"
-msgstr "Потребителят да укаже версия (задаване на променливата $REVISION)"
-
-#: lib/tools_dlg.tcl:82
-msgid "Ask the user for additional arguments (sets $ARGS)"
-msgstr ""
-"Потребителят да укаже допълнителни аргументи (задаване на променливата $ARGS)"
-
-#: lib/tools_dlg.tcl:89
-msgid "Don't show the command output window"
-msgstr "Без показване на прозорец с изхода от командата"
-
-#: lib/tools_dlg.tcl:94
-msgid "Run only if a diff is selected ($FILENAME not empty)"
-msgstr ""
-"Стартиране само след избор на разлика (променливата $FILENAME не е празна)"
-
-#: lib/tools_dlg.tcl:118
-msgid "Please supply a name for the tool."
-msgstr "Задайте име за командата."
-
-#: lib/tools_dlg.tcl:126
-#, tcl-format
-msgid "Tool '%s' already exists."
-msgstr "Командата „%s“ вече съществува."
-
-#: lib/tools_dlg.tcl:148
-#, tcl-format
-msgid ""
-"Could not add tool:\n"
-"%s"
-msgstr ""
-"Командата не може да бъде добавена:\n"
-"%s"
-
-#: lib/tools_dlg.tcl:187
-#, tcl-format
-msgid "%s (%s): Remove Tool"
-msgstr "%s (%s): Премахване на команда"
-
-#: lib/tools_dlg.tcl:193
-msgid "Remove Tool Commands"
-msgstr "Премахване на команди"
-
-#: lib/tools_dlg.tcl:198
-msgid "Remove"
-msgstr "Премахване"
-
-#: lib/tools_dlg.tcl:231
-msgid "(Blue denotes repository-local tools)"
-msgstr "(командите към локалното хранилище са обозначени в синьо)"
-
-#: lib/tools_dlg.tcl:283
-#, tcl-format
-msgid "%s (%s):"
-msgstr "%s (%s):"
-
-#: lib/tools_dlg.tcl:292
-#, tcl-format
-msgid "Run Command: %s"
-msgstr "Изпълнение на командата „%s“"
-
-#: lib/tools_dlg.tcl:306
-msgid "Arguments"
-msgstr "Аргументи"
-
-#: lib/tools_dlg.tcl:341
-msgid "OK"
-msgstr "Добре"
-
-#: lib/transport.tcl:7
-#, tcl-format
-msgid "Fetching new changes from %s"
-msgstr "Доставяне на промените от „%s“"
-
-#: lib/transport.tcl:18
-#, tcl-format
-msgid "remote prune %s"
-msgstr "окастряне на следящите клони към „%s“"
-
-#: lib/transport.tcl:19
-#, tcl-format
-msgid "Pruning tracking branches deleted from %s"
-msgstr "Окастряне на следящите клони на изтритите клони от „%s“"
-
-#: lib/transport.tcl:25
-msgid "fetch all remotes"
-msgstr "доставяне от всички отдалечени"
-
-#: lib/transport.tcl:26
-msgid "Fetching new changes from all remotes"
-msgstr "Доставяне на промените от всички отдалечени хранилища"
-
-#: lib/transport.tcl:40
-msgid "remote prune all remotes"
-msgstr "окастряне на следящите изтрити"
-
-#: lib/transport.tcl:41
-msgid "Pruning tracking branches deleted from all remotes"
-msgstr ""
-"Окастряне на следящите клони на изтритите клони от всички отдалечени "
-"хранилища"
-
-#: lib/transport.tcl:55
-#, tcl-format
-msgid "Pushing changes to %s"
-msgstr "Изтласкване на промените към „%s“"
-
-#: lib/transport.tcl:93
-#, tcl-format
-msgid "Mirroring to %s"
-msgstr "Изтласкване на всичко към „%s“"
-
-#: lib/transport.tcl:111
-#, tcl-format
-msgid "Pushing %s %s to %s"
-msgstr "Изтласкване на %s „%s“ към „%s“"
-
-#: lib/transport.tcl:132
-msgid "Push Branches"
-msgstr "Клони за изтласкване"
-
-#: lib/transport.tcl:147
-msgid "Source Branches"
-msgstr "Клони-източници"
-
-#: lib/transport.tcl:162
-msgid "Destination Repository"
-msgstr "Целево хранилище"
-
-#: lib/transport.tcl:205
-msgid "Transfer Options"
-msgstr "Настройки при пренасянето"
-
-#: lib/transport.tcl:207
-msgid "Force overwrite existing branch (may discard changes)"
-msgstr ""
-"Изрично презаписване на съществуващ клон (някои промени може да бъдат "
-"загубени)"
-
-#: lib/transport.tcl:211
-msgid "Use thin pack (for slow network connections)"
-msgstr "Максимална компресия (за бавни мрежови връзки)"
-
-#: lib/transport.tcl:215
-msgid "Include tags"
-msgstr "Включване на етикетите"
-
-#: lib/transport.tcl:229
-#, tcl-format
-msgid "%s (%s): Push"
-msgstr "%s (%s): Изтласкване"
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 8dbe21d588..7b44f70789 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -3,7 +3,7 @@
# Copyright (c) 2006 Eric Wong
#
-PERL='@@PERL@@'
+PERL='@PERL_PATH@'
OPTIONS_KEEPDASHDASH=
OPTIONS_STUCKLONG=
OPTIONS_SPEC="\
@@ -38,8 +38,8 @@ conf="$GIT_DIR/gitweb/httpd.conf"
# if installed, it doesn't need further configuration (module_path)
test -z "$httpd" && httpd='lighttpd -f'
-# Default is @@GITWEBDIR@@
-test -z "$root" && root='@@GITWEBDIR@@'
+# Default is @GITWEBDIR@
+test -z "$root" && root='@GITWEBDIR@'
# any untaken local port will do...
test -z "$port" && port=1234
@@ -694,9 +694,9 @@ class GitWebRequestHandler(CGIHTTPRequestHandler):
return result
-bind = "127.0.0.1"
+bind = "0.0.0.0"
if "$local" == "true":
- bind = "0.0.0.0"
+ bind = "127.0.0.1"
# Set our http root directory
# This is a work around for a missing directory argument in older Python versions
@@ -716,7 +716,7 @@ EOF
gitweb_conf() {
cat > "$fqgitdir/gitweb/gitweb_config.perl" <<EOF
-#!@@PERL@@
+#!@PERL_PATH@
our \$projectroot = "$(dirname "$fqgitdir")";
our \$git_temp = "$fqgitdir/gitweb/tmp";
our \$projects_list = \$projectroot;
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 1ff26170ff..11ea181259 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -159,7 +159,7 @@ check_unchanged () {
}
valid_tool () {
- setup_tool "$1" && return 0
+ setup_tool "$1" 2>/dev/null && return 0
cmd=$(get_merge_tool_cmd "$1")
test -n "$cmd"
}
@@ -250,7 +250,12 @@ setup_tool () {
. "$MERGE_TOOLS_DIR/${tool%[0-9]}"
else
setup_user_tool
- return $?
+ rc=$?
+ if test $rc -ne 0
+ then
+ echo >&2 "error: ${TOOL_MODE}tool.$tool.cmd not set for tool '$tool'"
+ fi
+ return $rc
fi
# Now let the user override the default command for the tool. If
@@ -259,6 +264,7 @@ setup_tool () {
if ! list_tool_variants | grep -q "^$tool$"
then
+ echo "error: unknown tool variant '$tool'" >&2
return 1
fi
@@ -474,7 +480,7 @@ get_merge_tool_path () {
merge_tool="$1"
if ! valid_tool "$merge_tool"
then
- echo >&2 "Unknown merge tool $merge_tool"
+ echo >&2 "Unknown $TOOL_MODE tool $merge_tool"
exit 1
fi
if diff_mode
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 01640a044b..775ba8ea11 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -112,7 +112,7 @@ find_matching_ref='
}
'
-set fnord $(git ls-remote "$url" | @@PERL@@ -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
+set fnord $(git ls-remote "$url" | @PERL_PATH@ -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
remote_sha1=$2
ref=$3
diff --git a/git-send-email.perl b/git-send-email.perl
index c4d12bebc8..798d59b84f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1501,7 +1501,7 @@ sub gen_header {
@recipients = unique_email_list(@recipients,@cc,@initial_bcc);
@recipients = (map { extract_valid_address_or_die($_) } @recipients);
my $date = format_2822_time($time++);
- my $gitversion = '@@GIT_VERSION@@';
+ my $gitversion = '@GIT_VERSION@';
if ($gitversion =~ m/..GIT_VERSION../) {
$gitversion = Git::version();
}
diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh
index a15c0620db..ae4b2d6ba9 100644
--- a/git-sh-i18n.sh
+++ b/git-sh-i18n.sh
@@ -9,7 +9,7 @@ TEXTDOMAIN=git
export TEXTDOMAIN
if test -z "$GIT_TEXTDOMAINDIR"
then
- TEXTDOMAINDIR="@@LOCALEDIR@@"
+ TEXTDOMAINDIR="@LOCALEDIR@"
else
TEXTDOMAINDIR="$GIT_TEXTDOMAINDIR"
fi
@@ -17,9 +17,9 @@ export TEXTDOMAINDIR
# First decide what scheme to use...
GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough
-if test -n "@@USE_GETTEXT_SCHEME@@"
+if test -n "@USE_GETTEXT_SCHEME@"
then
- GIT_INTERNAL_GETTEXT_SH_SCHEME="@@USE_GETTEXT_SCHEME@@"
+ GIT_INTERNAL_GETTEXT_SH_SCHEME="@USE_GETTEXT_SCHEME@"
elif test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
then
: no probing necessary
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index ce273fe0e4..19aef72ec2 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -41,7 +41,7 @@ git_broken_path_fix () {
esac
}
-# @@BROKEN_PATH_FIX@@
+# @BROKEN_PATH_FIX@
# Source git-sh-i18n for gettext support.
. "$(git --exec-path)/git-sh-i18n"
@@ -154,7 +154,7 @@ git_pager() {
else
GIT_PAGER=cat
fi
- for vardef in @@PAGER_ENV@@
+ for vardef in @PAGER_ENV@
do
var=${vardef%%=*}
eval ": \"\${$vardef}\" && export $var"
@@ -280,7 +280,7 @@ get_author_ident_from_commit () {
# remove lines from $1 that are not in $2, leaving only common lines.
create_virtual_base() {
sz0=$(wc -c <"$1")
- @@DIFF@@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add
+ @DIFF@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add
sz1=$(wc -c <"$1")
# If we do not have enough common material, it is not
diff --git a/git-submodule.sh b/git-submodule.sh
index 03c5a220a2..2999b31fad 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -40,11 +40,11 @@ init=
require_init=
files=
remote=
-nofetch=
+no_fetch=
rebase=
merge=
checkout=
-custom_name=
+name=
depth=
progress=
dissociate=
@@ -52,11 +52,10 @@ single_branch=
jobs=
recommend_shallow=
filter=
-
-isnumber()
-{
- n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
-}
+all=
+default=
+summary_limit=
+for_status=
#
# Add a new submodule to the working tree, .gitmodules and the index
@@ -68,31 +67,33 @@ isnumber()
cmd_add()
{
# parse $args after "submodule ... add".
- reference_path=
while test $# -ne 0
do
case "$1" in
-b | --branch)
case "$2" in '') usage ;; esac
- branch=$2
+ branch="--branch=$2"
shift
;;
+ -b* | --branch=*)
+ branch="$1"
+ ;;
-f | --force)
force=$1
;;
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--progress)
- progress=1
+ progress=$1
;;
--reference)
case "$2" in '') usage ;; esac
- reference_path=$2
+ reference="--reference=$2"
shift
;;
--reference=*)
- reference_path="${1#--reference=}"
+ reference="$1"
;;
--ref-format)
case "$2" in '') usage ;; esac
@@ -103,20 +104,23 @@ cmd_add()
ref_format="$1"
;;
--dissociate)
- dissociate=1
+ dissociate=$1
;;
--name)
case "$2" in '') usage ;; esac
- custom_name=$2
+ name="--name=$2"
shift
;;
+ --name=*)
+ name="$1"
+ ;;
--depth)
case "$2" in '') usage ;; esac
depth="--depth=$2"
shift
;;
--depth=*)
- depth=$1
+ depth="$1"
;;
--)
shift
@@ -138,14 +142,14 @@ cmd_add()
fi
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper add \
- ${quiet:+--quiet} \
- ${force:+--force} \
- ${progress:+"--progress"} \
- ${branch:+--branch "$branch"} \
- ${reference_path:+--reference "$reference_path"} \
+ $quiet \
+ $force \
+ $progress \
+ ${branch:+"$branch"} \
+ ${reference:+"$reference"} \
${ref_format:+"$ref_format"} \
- ${dissociate:+--dissociate} \
- ${custom_name:+--name "$custom_name"} \
+ $dissociate \
+ ${name:+"$name"} \
${depth:+"$depth"} \
-- \
"$@"
@@ -164,10 +168,10 @@ cmd_foreach()
do
case "$1" in
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--recursive)
- recursive=1
+ recursive=$1
;;
-*)
usage
@@ -180,8 +184,8 @@ cmd_foreach()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper foreach \
- ${quiet:+--quiet} \
- ${recursive:+--recursive} \
+ $quiet \
+ $recursive \
-- \
"$@"
}
@@ -198,7 +202,7 @@ cmd_init()
do
case "$1" in
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--)
shift
@@ -215,7 +219,7 @@ cmd_init()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper init \
- ${quiet:+--quiet} \
+ $quiet \
-- \
"$@"
}
@@ -226,7 +230,6 @@ cmd_init()
cmd_deinit()
{
# parse $args after "submodule ... deinit".
- deinit_all=
while test $# -ne 0
do
case "$1" in
@@ -234,10 +237,10 @@ cmd_deinit()
force=$1
;;
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--all)
- deinit_all=t
+ all=$1
;;
--)
shift
@@ -254,9 +257,9 @@ cmd_deinit()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper deinit \
- ${quiet:+--quiet} \
- ${force:+--force} \
- ${deinit_all:+--all} \
+ $quiet \
+ $force \
+ $all \
-- \
"$@"
}
@@ -273,31 +276,31 @@ cmd_update()
do
case "$1" in
-q|--quiet)
- quiet=1
+ quiet=$1
;;
-v|--verbose)
- quiet=0
+ quiet=
;;
--progress)
- progress=1
+ progress=$1
;;
-i|--init)
- init=1
+ init=$1
;;
--require-init)
- require_init=1
+ require_init=$1
;;
--remote)
- remote=1
+ remote=$1
;;
-N|--no-fetch)
- nofetch=1
+ no_fetch=$1
;;
-f|--force)
force=$1
;;
-r|--rebase)
- rebase=1
+ rebase=$1
;;
--ref-format)
case "$2" in '') usage ;; esac
@@ -316,22 +319,19 @@ cmd_update()
reference="$1"
;;
--dissociate)
- dissociate=1
+ dissociate=$1
;;
-m|--merge)
- merge=1
+ merge=$1
;;
--recursive)
- recursive=1
+ recursive=$1
;;
--checkout)
- checkout=1
- ;;
- --recommend-shallow)
- recommend_shallow="--recommend-shallow"
+ checkout=$1
;;
- --no-recommend-shallow)
- recommend_shallow="--no-recommend-shallow"
+ --recommend-shallow|--no-recommend-shallow)
+ recommend_shallow=$1
;;
--depth)
case "$2" in '') usage ;; esac
@@ -339,21 +339,18 @@ cmd_update()
shift
;;
--depth=*)
- depth=$1
+ depth="$1"
;;
-j|--jobs)
case "$2" in '') usage ;; esac
jobs="--jobs=$2"
shift
;;
- --jobs=*)
- jobs=$1
+ -j*|--jobs=*)
+ jobs="$1"
;;
- --single-branch)
- single_branch="--single-branch"
- ;;
- --no-single-branch)
- single_branch="--no-single-branch"
+ --single-branch|--no-single-branch)
+ single_branch=$1
;;
--filter)
case "$2" in '') usage ;; esac
@@ -378,22 +375,21 @@ cmd_update()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper update \
- ${quiet:+--quiet} \
- ${force:+--force} \
- ${progress:+"--progress"} \
- ${remote:+--remote} \
- ${recursive:+--recursive} \
- ${init:+--init} \
- ${nofetch:+--no-fetch} \
- ${rebase:+--rebase} \
- ${merge:+--merge} \
- ${checkout:+--checkout} \
+ $quiet \
+ $force \
+ $progress \
+ $remote \
+ $recursive \
+ $init \
+ $no_fetch \
+ $rebase \
+ $merge \
+ $checkout \
${ref_format:+"$ref_format"} \
${reference:+"$reference"} \
- ${dissociate:+"--dissociate"} \
+ $dissociate \
${depth:+"$depth"} \
- ${require_init:+--require-init} \
- ${dissociate:+"--dissociate"} \
+ $require_init \
$single_branch \
$recommend_shallow \
$jobs \
@@ -408,9 +404,7 @@ cmd_update()
# $@ = requested path
#
cmd_set_branch() {
- default=
- branch=
-
+ # parse $args after "submodule ... set-branch".
while test $# -ne 0
do
case "$1" in
@@ -418,13 +412,16 @@ cmd_set_branch() {
# we don't do anything with this but we need to accept it
;;
-d|--default)
- default=1
+ default=$1
;;
-b|--branch)
case "$2" in '') usage ;; esac
- branch=$2
+ branch="--branch=$2"
shift
;;
+ -b*|--branch=*)
+ branch="$1"
+ ;;
--)
shift
break
@@ -440,9 +437,9 @@ cmd_set_branch() {
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-branch \
- ${quiet:+--quiet} \
- ${branch:+--branch "$branch"} \
- ${default:+--default} \
+ $quiet \
+ ${branch:+"$branch"} \
+ $default \
-- \
"$@"
}
@@ -453,11 +450,12 @@ cmd_set_branch() {
# $@ = requested path, requested url
#
cmd_set_url() {
+ # parse $args after "submodule ... set-url".
while test $# -ne 0
do
case "$1" in
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--)
shift
@@ -474,7 +472,7 @@ cmd_set_url() {
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper set-url \
- ${quiet:+--quiet} \
+ $quiet \
-- \
"$@"
}
@@ -488,31 +486,26 @@ cmd_set_url() {
# $@ = [commit (default 'HEAD'),] requested paths (default all)
#
cmd_summary() {
- summary_limit=-1
- for_status=
- diff_cmd=diff-index
-
# parse $args after "submodule ... summary".
while test $# -ne 0
do
case "$1" in
--cached)
- cached=1
+ cached=$1
;;
--files)
- files="$1"
+ files=$1
;;
--for-status)
- for_status="$1"
+ for_status=$1
;;
-n|--summary-limit)
- summary_limit="$2"
- isnumber "$summary_limit" || usage
+ case "$2" in '') usage ;; esac
+ summary_limit="--summary-limit=$2"
shift
;;
- --summary-limit=*)
- summary_limit="${1#--summary-limit=}"
- isnumber "$summary_limit" || usage
+ -n*|--summary-limit=*)
+ summary_limit="$1"
;;
--)
shift
@@ -529,10 +522,10 @@ cmd_summary() {
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper summary \
- ${files:+--files} \
- ${cached:+--cached} \
- ${for_status:+--for-status} \
- ${summary_limit:+-n $summary_limit} \
+ $files \
+ $cached \
+ $for_status \
+ ${summary_limit:+"$summary_limit"} \
-- \
"$@"
}
@@ -553,13 +546,13 @@ cmd_status()
do
case "$1" in
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--cached)
- cached=1
+ cached=$1
;;
--recursive)
- recursive=1
+ recursive=$1
;;
--)
shift
@@ -576,9 +569,9 @@ cmd_status()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper status \
- ${quiet:+--quiet} \
- ${cached:+--cached} \
- ${recursive:+--recursive} \
+ $quiet \
+ $cached \
+ $recursive \
-- \
"$@"
}
@@ -590,15 +583,16 @@ cmd_status()
#
cmd_sync()
{
+ # parse $args after "submodule ... sync".
while test $# -ne 0
do
case "$1" in
-q|--quiet)
- quiet=1
+ quiet=$1
shift
;;
--recursive)
- recursive=1
+ recursive=$1
shift
;;
--)
@@ -615,8 +609,8 @@ cmd_sync()
done
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync \
- ${quiet:+--quiet} \
- ${recursive:+--recursive} \
+ $quiet \
+ $recursive \
-- \
"$@"
}
@@ -639,10 +633,10 @@ do
command=$1
;;
-q|--quiet)
- quiet=1
+ quiet=$1
;;
--cached)
- cached=1
+ cached=$1
;;
--)
break
diff --git a/git-svn.perl b/git-svn.perl
index 9c7c629932..32c648c395 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -9,7 +9,7 @@ use vars qw/ $AUTHOR $VERSION
$_revision $_repository
$_q $_authors $_authors_prog %users/;
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
-$VERSION = '@@GIT_VERSION@@';
+$VERSION = '@GIT_VERSION@';
use Carp qw/croak/;
use File::Basename qw/dirname basename/;
diff --git a/git.c b/git.c
index 46b3c740c5..a94dab3770 100644
--- a/git.c
+++ b/git.c
@@ -55,7 +55,7 @@ static void list_builtins(struct string_list *list, unsigned int exclude_option)
static void exclude_helpers_from_list(struct string_list *list)
{
- int i = 0;
+ size_t i = 0;
while (i < list->nr) {
if (strstr(list->items[i].string, "--"))
@@ -75,7 +75,6 @@ static int match_token(const char *spec, int len, const char *token)
static int list_cmds(const char *spec)
{
struct string_list list = STRING_LIST_INIT_DUP;
- int i;
int nongit;
/*
@@ -113,7 +112,7 @@ static int list_cmds(const char *spec)
if (*spec == ',')
spec++;
}
- for (i = 0; i < list.nr; i++)
+ for (size_t i = 0; i < list.nr; i++)
puts(list.items[i].string);
string_list_clear(&list, 0);
return 0;
@@ -126,7 +125,7 @@ static void commit_pager_choice(void)
setenv("GIT_PAGER", "cat", 1);
break;
case 1:
- setup_pager();
+ setup_pager(the_repository);
break;
default:
break;
@@ -137,7 +136,7 @@ void setup_auto_pager(const char *cmd, int def)
{
if (use_pager != -1 || pager_in_use())
return;
- use_pager = check_pager_config(cmd);
+ use_pager = check_pager_config(the_repository, cmd);
if (use_pager == -1)
use_pager = def;
commit_pager_choice();
@@ -322,10 +321,9 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
trace2_cmd_name("_query_");
if (!strcmp(cmd, "parseopt")) {
struct string_list list = STRING_LIST_INIT_DUP;
- int i;
list_builtins(&list, NO_PARSEOPT);
- for (i = 0; i < list.nr; i++)
+ for (size_t i = 0; i < list.nr; i++)
printf("%s ", list.items[i].string);
string_list_clear(&list, 0);
exit(0);
@@ -464,12 +462,12 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
precompose_argv_prefix(argc, argv, NULL);
if (use_pager == -1 && run_setup &&
!(p->option & DELAY_PAGER_CONFIG))
- use_pager = check_pager_config(p->cmd);
+ use_pager = check_pager_config(the_repository, p->cmd);
if (use_pager == -1 && p->option & USE_PAGER)
use_pager = 1;
if (run_setup && startup_info->have_repository)
/* get_git_dir() may set up repo, avoid that */
- trace_repo_setup();
+ trace_repo_setup(the_repository);
commit_pager_choice();
if (!help && p->option & NEED_WORK_TREE)
@@ -651,8 +649,7 @@ static struct cmd_struct commands[] = {
static struct cmd_struct *get_builtin(const char *s)
{
- int i;
- for (i = 0; i < ARRAY_SIZE(commands); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(commands); i++) {
struct cmd_struct *p = commands + i;
if (!strcmp(s, p->cmd))
return p;
@@ -667,8 +664,7 @@ int is_builtin(const char *s)
static void list_builtins(struct string_list *out, unsigned int exclude_option)
{
- int i;
- for (i = 0; i < ARRAY_SIZE(commands); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(commands); i++) {
if (exclude_option &&
(commands[i].option & exclude_option))
continue;
@@ -679,7 +675,6 @@ static void list_builtins(struct string_list *out, unsigned int exclude_option)
void load_builtin_commands(const char *prefix, struct cmdnames *cmds)
{
const char *name;
- int i;
/*
* Callers can ask for a subset of the commands based on a certain
@@ -690,7 +685,7 @@ void load_builtin_commands(const char *prefix, struct cmdnames *cmds)
if (!skip_prefix(prefix, "git-", &prefix))
BUG("prefix '%s' must start with 'git-'", prefix);
- for (i = 0; i < ARRAY_SIZE(commands); i++)
+ for (size_t i = 0; i < ARRAY_SIZE(commands); i++)
if (skip_prefix(commands[i].cmd, prefix, &name))
add_cmdname(cmds, name, strlen(name));
}
@@ -755,7 +750,7 @@ static void execv_dashed_external(const char **argv)
int status;
if (use_pager == -1 && !is_builtin(argv[0]))
- use_pager = check_pager_config(argv[0]);
+ use_pager = check_pager_config(the_repository, argv[0]);
commit_pager_choice();
strvec_pushf(&cmd.args, "git-%s", argv[0]);
@@ -812,7 +807,7 @@ static int run_argv(struct strvec *args)
handle_builtin(args);
else if (get_builtin(args->v[0])) {
struct child_process cmd = CHILD_PROCESS_INIT;
- int i;
+ int err;
/*
* The current process is committed to launching a
@@ -826,7 +821,7 @@ static int run_argv(struct strvec *args)
commit_pager_choice();
strvec_push(&cmd.args, "git");
- for (i = 0; i < args->nr; i++)
+ for (size_t i = 0; i < args->nr; i++)
strvec_push(&cmd.args, args->v[i]);
trace_argv_printf(cmd.args.v, "trace: exec:");
@@ -839,9 +834,9 @@ static int run_argv(struct strvec *args)
cmd.clean_on_exit = 1;
cmd.wait_after_clean = 1;
cmd.trace2_child_class = "git_alias";
- i = run_command(&cmd);
- if (i >= 0 || errno != ENOENT)
- exit(i);
+ err = run_command(&cmd);
+ if (err >= 0 || errno != ENOENT)
+ exit(err);
die("could not execute builtin %s", args->v[0]);
}
@@ -850,9 +845,8 @@ static int run_argv(struct strvec *args)
seen = unsorted_string_list_lookup(&cmd_list, args->v[0]);
if (seen) {
- int i;
struct strbuf sb = STRBUF_INIT;
- for (i = 0; i < cmd_list.nr; i++) {
+ for (size_t i = 0; i < cmd_list.nr; i++) {
struct string_list_item *item = &cmd_list.items[i];
strbuf_addf(&sb, "\n %s", item->string);
@@ -946,7 +940,7 @@ int cmd_main(int argc, const char **argv)
*/
setup_path();
- for (size_t i = 0; i < argc; i++)
+ for (int i = 0; i < argc; i++)
strvec_push(&args, argv[i]);
while (1) {
diff --git a/git.rc b/git.rc.in
index cc3fdc6cc6..e69444eef3 100644
--- a/git.rc
+++ b/git.rc.in
@@ -1,6 +1,6 @@
1 VERSIONINFO
-FILEVERSION MAJOR,MINOR,MICRO,PATCHLEVEL
-PRODUCTVERSION MAJOR,MINOR,MICRO,PATCHLEVEL
+FILEVERSION @GIT_MAJOR_VERSION@,@GIT_MINOR_VERSION@,@GIT_MICRO_VERSION@,@GIT_PATCH_LEVEL@
+PRODUCTVERSION @GIT_MAJOR_VERSION@,@GIT_MINOR_VERSION@,@GIT_MICRO_VERSION@,@GIT_PATCH_LEVEL@
BEGIN
BLOCK "StringFileInfo"
BEGIN
@@ -11,7 +11,7 @@ BEGIN
VALUE "InternalName", "git\0"
VALUE "OriginalFilename", "git.exe\0"
VALUE "ProductName", "Git\0"
- VALUE "ProductVersion", GIT_VERSION "\0"
+ VALUE "ProductVersion", "@GIT_VERSION@\0"
END
END
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 7a087f123d..47a7c1d29c 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -1969,6 +1969,10 @@ proc confirm_popup {msg {owner .}} {
return $confirm_ok
}
+proc haveselectionclipboard {} {
+ return [expr {[tk windowingsystem] eq "x11"}]
+}
+
proc setoptions {} {
global use_ttk
@@ -2089,7 +2093,7 @@ proc makewindow {} {
global diffcontextstring diffcontext
global ignorespace
global maincursor textcursor curtextcursor
- global rowctxmenu fakerowmenu mergemax wrapcomment
+ global rowctxmenu fakerowmenu mergemax wrapcomment wrapdefault
global highlight_files gdttype
global searchstring sstring
global bgcolor fgcolor bglist fglist diffcolors diffbgcolors selectbgcolor
@@ -2223,7 +2227,7 @@ proc makewindow {} {
set sha1entry .tf.bar.sha1
set entries $sha1entry
set sha1but .tf.bar.sha1label
- button $sha1but -text "[mc "SHA1 ID:"] " -state disabled -relief flat \
+ button $sha1but -text "[mc "Commit ID:"] " -state disabled -relief flat \
-command gotocommit -width 8
$sha1but conf -disabledforeground [$sha1but cget -foreground]
pack .tf.bar.sha1label -side left
@@ -2431,7 +2435,7 @@ proc makewindow {} {
set ctext .bleft.bottom.ctext
text $ctext -background $bgcolor -foreground $fgcolor \
-state disabled -undo 0 -font textfont \
- -yscrollcommand scrolltext -wrap none \
+ -yscrollcommand scrolltext -wrap $wrapdefault \
-xscrollcommand ".bleft.bottom.sbhorizontal set"
if {$have_tk85} {
$ctext conf -tabstyle wordprocessor
@@ -7344,7 +7348,7 @@ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
global mergemax numcommits pending_select
global cmitmode showneartags allcommits
global targetrow targetid lastscrollrows
- global autoselect autosellen jump_to_here
+ global autocopy autoselect autosellen jump_to_here
global vinlinediff
unset -nocomplain pending_select
@@ -7410,9 +7414,13 @@ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
$sha1entry delete 0 end
$sha1entry insert 0 $id
- if {$autoselect} {
+ if {$autoselect && [haveselectionclipboard]} {
$sha1entry selection range 0 $autosellen
}
+ if {$autocopy} {
+ clipboard clear
+ clipboard append [string range $id 0 [expr $autosellen - 1]]
+ }
rhighlight_sel $id
$ctext conf -state normal
@@ -8756,7 +8764,7 @@ proc sha1change {n1 n2 op} {
if {$state == "normal"} {
$sha1but conf -state normal -relief raised -text "[mc "Goto:"] "
} else {
- $sha1but conf -state disabled -relief flat -text "[mc "SHA1 ID:"] "
+ $sha1but conf -state disabled -relief flat -text "[mc "Commit ID:"] "
}
}
@@ -8775,7 +8783,7 @@ proc gotocommit {} {
set matches [longid $id]
if {$matches ne {}} {
if {[llength $matches] > 1} {
- error_popup [mc "Short SHA1 id %s is ambiguous" $id]
+ error_popup [mc "Short commit ID %s is ambiguous" $id]
return
}
set id [lindex $matches 0]
@@ -8792,7 +8800,7 @@ proc gotocommit {} {
return
}
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
- set msg [mc "SHA1 id %s is not known" $sha1string]
+ set msg [mc "Commit ID %s is not known" $sha1string]
} else {
set msg [mc "Revision %s is not in the current view" $sha1string]
}
@@ -11576,12 +11584,13 @@ proc create_prefs_page {w} {
proc prefspage_general {notebook} {
global NS maxwidth maxgraphpct showneartags showlocalchanges
- global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
+ global tabstop wrapcomment wrapdefault limitdiffs
+ global autocopy autoselect autosellen extdifftool perfile_attrs
global hideremotes want_ttk have_ttk maxrefs web_browser
set page [create_prefs_page $notebook.general]
- ${NS}::label $page.ldisp -text [mc "Commit list display options"]
+ ${NS}::label $page.ldisp -text [mc "Commit list display options"] -font mainfontbold
grid $page.ldisp - -sticky w -pady 10
${NS}::label $page.spacer -text " "
${NS}::label $page.maxwidthl -text [mc "Maximum graph width (lines)"]
@@ -11594,19 +11603,38 @@ proc prefspage_general {notebook} {
${NS}::checkbutton $page.showlocal -text [mc "Show local changes"] \
-variable showlocalchanges
grid x $page.showlocal -sticky w
- ${NS}::checkbutton $page.autoselect -text [mc "Auto-select SHA1 (length)"] \
- -variable autoselect
- spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
- grid x $page.autoselect $page.autosellen -sticky w
${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
-variable hideremotes
grid x $page.hideremotes -sticky w
- ${NS}::label $page.ddisp -text [mc "Diff display options"]
+ ${NS}::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \
+ -variable autocopy
+ grid x $page.autocopy -sticky w
+ if {[haveselectionclipboard]} {
+ ${NS}::checkbutton $page.autoselect -text [mc "Copy commit ID to X11 selection"] \
+ -variable autoselect
+ grid x $page.autoselect -sticky w
+ }
+ spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
+ ${NS}::label $page.autosellenl -text [mc "Length of commit ID to copy"]
+ grid x $page.autosellenl $page.autosellen -sticky w
+
+ ${NS}::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold
grid $page.ddisp - -sticky w -pady 10
${NS}::label $page.tabstopl -text [mc "Tab spacing"]
spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $page.tabstopl $page.tabstop -sticky w
+
+ ${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"]
+ ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \
+ -textvariable wrapcomment
+ grid x $page.wrapcommentl $page.wrapcomment -sticky w
+
+ ${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"]
+ ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \
+ -textvariable wrapdefault
+ grid x $page.wrapdefaultl $page.wrapdefault -sticky w
+
${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \
-variable showneartags
grid x $page.ntag -sticky w
@@ -11635,7 +11663,7 @@ proc prefspage_general {notebook} {
pack configure $page.webbrowserf.l -padx 10
grid x $page.webbrowserf $page.webbrowser -sticky ew
- ${NS}::label $page.lgen -text [mc "General options"]
+ ${NS}::label $page.lgen -text [mc "General options"] -font mainfontbold
grid $page.lgen - -sticky w -pady 10
${NS}::checkbutton $page.want_ttk -variable want_ttk \
-text [mc "Use themed widgets"]
@@ -11654,7 +11682,7 @@ proc prefspage_colors {notebook} {
set page [create_prefs_page $notebook.colors]
- ${NS}::label $page.cdisp -text [mc "Colors: press to choose"]
+ ${NS}::label $page.cdisp -text [mc "Colors: press to choose"] -font mainfontbold
grid $page.cdisp - -sticky w -pady 10
label $page.ui -padx 40 -relief sunk -background $uicolor
${NS}::button $page.uibut -text [mc "Interface"] \
@@ -11712,7 +11740,7 @@ proc prefspage_colors {notebook} {
proc prefspage_fonts {notebook} {
global NS
set page [create_prefs_page $notebook.fonts]
- ${NS}::label $page.cfont -text [mc "Fonts: press to choose"]
+ ${NS}::label $page.cfont -text [mc "Fonts: press to choose"] -font mainfontbold
grid $page.cfont - -sticky w -pady 10
mkfontdisp mainfont $page [mc "Main font"]
mkfontdisp textfont $page [mc "Diff display font"]
@@ -11725,7 +11753,7 @@ proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
- global hideremotes want_ttk have_ttk
+ global hideremotes want_ttk have_ttk wrapcomment wrapdefault
set top .gitkprefs
set prefstop $top
@@ -11734,7 +11762,7 @@ proc doprefs {} {
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
set oldprefs($v) [set $v]
}
ttk_toplevel $top
@@ -11860,7 +11888,7 @@ proc prefscan {} {
global oldprefs prefstop
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
global $v
set $v $oldprefs($v)
}
@@ -11874,7 +11902,8 @@ proc prefsok {} {
global oldprefs prefstop showneartags showlocalchanges
global fontpref mainfont textfont uifont
global limitdiffs treediffs perfile_attrs
- global hideremotes
+ global hideremotes wrapcomment wrapdefault
+ global ctext
catch {destroy $prefstop}
unset prefstop
@@ -11923,6 +11952,12 @@ proc prefsok {} {
if {$hideremotes != $oldprefs(hideremotes)} {
rereadrefs
}
+ if {$wrapcomment != $oldprefs(wrapcomment)} {
+ $ctext tag conf comment -wrap $wrapcomment
+ }
+ if {$wrapdefault != $oldprefs(wrapdefault)} {
+ $ctext configure -wrap $wrapdefault
+ }
}
proc formatdate {d} {
@@ -12392,6 +12427,7 @@ set downarrowlen 5
set mingaplen 100
set cmitmode "patch"
set wrapcomment "none"
+set wrapdefault "none"
set showneartags 1
set hideremotes 0
set maxrefs 20
@@ -12400,6 +12436,7 @@ set maxlinelen 200
set showlocalchanges 1
set limitdiffs 1
set datetimeformat "%Y-%m-%d %H:%M:%S"
+set autocopy 0
set autoselect 1
set autosellen 40
set perfile_attrs 0
@@ -12497,7 +12534,8 @@ config_check_tmp_exists 50
set config_variables {
mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
- cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs
+ cmitmode wrapcomment wrapdefault autocopy autoselect autosellen
+ showneartags maxrefs visiblerefs
hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
@@ -12687,7 +12725,7 @@ catch {
wm iconphoto . -default gitlogo gitlogo32
}
# wait for the window to become visible
-tkwait visibility .
+if {![winfo viewable .]} {tkwait visibility .}
set_window_title
update
readrefs
diff --git a/gitk-git/po/bg.po b/gitk-git/po/bg.po
index 87ab1fac24..773a049831 100644
--- a/gitk-git/po/bg.po
+++ b/gitk-git/po/bg.po
@@ -1,15 +1,15 @@
# Bulgarian translation of gitk po-file.
-# Copyright (C) 2014, 2015, 2019 Alexander Shopov <ash@kambanaria.org>.
+# Copyright (C) 2014, 2015, 2019, 2020, 2024 Alexander Shopov <ash@kambanaria.org>.
# This file is distributed under the same license as the git package.
-# Alexander Shopov <ash@kambanaria.org>, 2014, 2015, 2019.
+# Alexander Shopov <ash@kambanaria.org>, 2014, 2015, 2019, 2020, 2024.
#
#
msgid ""
msgstr ""
"Project-Id-Version: gitk master\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-03-04 11:27+0100\n"
-"PO-Revision-Date: 2019-03-04 11:39+0100\n"
+"POT-Creation-Date: 2024-12-24 11:01+0100\n"
+"PO-Revision-Date: 2024-12-24 11:05+0100\n"
"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
"Language: bg\n"
@@ -18,32 +18,32 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: gitk:140
+#: gitk:139
msgid "Couldn't get list of unmerged files:"
-msgstr "Списъкът с неслети файлове не може да бъде получен:"
+msgstr "Списъкът с неслети файлове не може да се получи:"
-#: gitk:212 gitk:2403
+#: gitk:211 gitk:2430
msgid "Color words"
msgstr "Оцветяване на думите"
-#: gitk:217 gitk:2403 gitk:8249 gitk:8282
+#: gitk:216 gitk:2430 gitk:8335 gitk:8368
msgid "Markup words"
msgstr "Отбелязване на думите"
-#: gitk:324
+#: gitk:323
msgid "Error parsing revisions:"
msgstr "Грешка при анализ на версиите:"
-#: gitk:380
+#: gitk:389
msgid "Error executing --argscmd command:"
msgstr "Грешка при изпълнение на командата с „--argscmd“."
-#: gitk:393
+#: gitk:402
msgid "No files selected: --merge specified but no files are unmerged."
msgstr ""
"Не са избрани файлове — указана е опцията „--merge“, но няма неслети файлове."
-#: gitk:396
+#: gitk:405
msgid ""
"No files selected: --merge specified but no unmerged files are within file "
"limit."
@@ -51,326 +51,326 @@ msgstr ""
"Не са избрани файлове — указана е опцията „--merge“, но няма неслети файлове "
"в ограниченията."
-#: gitk:418 gitk:566
+#: gitk:430 gitk:585
msgid "Error executing git log:"
msgstr "Грешка при изпълнение на „git log“:"
-#: gitk:436 gitk:582
+#: gitk:448 gitk:601
msgid "Reading"
msgstr "Прочитане"
-#: gitk:496 gitk:4549
+#: gitk:508 gitk:4596
msgid "Reading commits..."
msgstr "Прочитане на подаванията…"
-#: gitk:499 gitk:1641 gitk:4552
+#: gitk:511 gitk:1660 gitk:4599
msgid "No commits selected"
msgstr "Не са избрани подавания"
-#: gitk:1449 gitk:4069 gitk:12583
+#: gitk:1468 gitk:4116 gitk:12738
msgid "Command line"
msgstr "Команден ред"
-#: gitk:1515
+#: gitk:1534
msgid "Can't parse git log output:"
msgstr "Изходът от „git log“ не може да се анализира:"
-#: gitk:1744
+#: gitk:1763
msgid "No commit information available"
msgstr "Липсва информация за подавания"
-#: gitk:1907 gitk:1936 gitk:4339 gitk:9789 gitk:11388 gitk:11668
+#: gitk:1930 gitk:1959 gitk:4386 gitk:9875 gitk:11485 gitk:11805
msgid "OK"
msgstr "Добре"
-#: gitk:1938 gitk:4341 gitk:9225 gitk:9304 gitk:9434 gitk:9520 gitk:9791
-#: gitk:11389 gitk:11669
+#: gitk:1961 gitk:4388 gitk:9311 gitk:9390 gitk:9520 gitk:9606 gitk:9877
+#: gitk:11486 gitk:11806
msgid "Cancel"
msgstr "Отказ"
-#: gitk:2087
+#: gitk:2114
msgid "&Update"
msgstr "&Обновяване"
-#: gitk:2088
+#: gitk:2115
msgid "&Reload"
msgstr "&Презареждане"
-#: gitk:2089
+#: gitk:2116
msgid "Reread re&ferences"
-msgstr "&Наново прочитане"
+msgstr "Прочитане &наново"
-#: gitk:2090
+#: gitk:2117
msgid "&List references"
msgstr "&Изброяване на указателите"
-#: gitk:2092
+#: gitk:2119
msgid "Start git &gui"
msgstr "&Стартиране на „git gui“"
-#: gitk:2094
+#: gitk:2121
msgid "&Quit"
msgstr "&Спиране на програмата"
-#: gitk:2086
+#: gitk:2113
msgid "&File"
msgstr "&Файл"
-#: gitk:2098
+#: gitk:2125
msgid "&Preferences"
msgstr "&Настройки"
-#: gitk:2097
+#: gitk:2124
msgid "&Edit"
msgstr "&Редактиране"
-#: gitk:2102
+#: gitk:2129
msgid "&New view..."
msgstr "&Нов изглед…"
-#: gitk:2103
+#: gitk:2130
msgid "&Edit view..."
msgstr "&Редактиране на изгледа…"
-#: gitk:2104
+#: gitk:2131
msgid "&Delete view"
msgstr "&Изтриване на изгледа"
-#: gitk:2106
+#: gitk:2133
msgid "&All files"
msgstr "&Всички файлове"
-#: gitk:2101
+#: gitk:2128
msgid "&View"
msgstr "&Изглед"
-#: gitk:2111 gitk:2121
+#: gitk:2138 gitk:2148
msgid "&About gitk"
msgstr "&Относно gitk"
-#: gitk:2112 gitk:2126
+#: gitk:2139 gitk:2153
msgid "&Key bindings"
msgstr "&Клавишни комбинации"
-#: gitk:2110 gitk:2125
+#: gitk:2137 gitk:2152
msgid "&Help"
msgstr "Помо&щ"
-#: gitk:2203 gitk:8681
-msgid "SHA1 ID:"
-msgstr "SHA1:"
+#: gitk:2230 gitk:8767
+msgid "Commit ID:"
+msgstr "Подаване:"
-#: gitk:2247
+#: gitk:2274
msgid "Row"
msgstr "Ред"
-#: gitk:2285
+#: gitk:2312
msgid "Find"
msgstr "Търсене"
-#: gitk:2313
+#: gitk:2340
msgid "commit"
msgstr "подаване"
-#: gitk:2317 gitk:2319 gitk:4711 gitk:4734 gitk:4758 gitk:6779 gitk:6851
-#: gitk:6936
+#: gitk:2344 gitk:2346 gitk:4758 gitk:4781 gitk:4805 gitk:6826 gitk:6898
+#: gitk:6983
msgid "containing:"
msgstr "съдържащо:"
-#: gitk:2320 gitk:3550 gitk:3555 gitk:4787
+#: gitk:2347 gitk:3597 gitk:3602 gitk:4834
msgid "touching paths:"
msgstr "в пътищата:"
-#: gitk:2321 gitk:4801
+#: gitk:2348 gitk:4848
msgid "adding/removing string:"
msgstr "добавящо/премахващо низ"
-#: gitk:2322 gitk:4803
+#: gitk:2349 gitk:4850
msgid "changing lines matching:"
msgstr "променящо редове напасващи:"
-#: gitk:2331 gitk:2333 gitk:4790
+#: gitk:2358 gitk:2360 gitk:4837
msgid "Exact"
msgstr "Точно"
-#: gitk:2333 gitk:4878 gitk:6747
+#: gitk:2360 gitk:4925 gitk:6794
msgid "IgnCase"
msgstr "Без регистър"
-#: gitk:2333 gitk:4760 gitk:4876 gitk:6743
+#: gitk:2360 gitk:4807 gitk:4923 gitk:6790
msgid "Regexp"
msgstr "Рег. израз"
-#: gitk:2335 gitk:2336 gitk:4898 gitk:4928 gitk:4935 gitk:6872 gitk:6940
+#: gitk:2362 gitk:2363 gitk:4945 gitk:4975 gitk:4982 gitk:6919 gitk:6987
msgid "All fields"
msgstr "Всички полета"
-#: gitk:2336 gitk:4895 gitk:4928 gitk:6810
+#: gitk:2363 gitk:4942 gitk:4975 gitk:6857
msgid "Headline"
msgstr "Първи ред"
-#: gitk:2337 gitk:4895 gitk:6810 gitk:6940 gitk:7413
+#: gitk:2364 gitk:4942 gitk:6857 gitk:6987 gitk:7499
msgid "Comments"
msgstr "Коментари"
-#: gitk:2337 gitk:4895 gitk:4900 gitk:4935 gitk:6810 gitk:7348 gitk:8859
-#: gitk:8874
+#: gitk:2364 gitk:4942 gitk:4947 gitk:4982 gitk:6857 gitk:7434 gitk:8945
+#: gitk:8960
msgid "Author"
msgstr "Автор"
-#: gitk:2337 gitk:4895 gitk:6810 gitk:7350
+#: gitk:2364 gitk:4942 gitk:6857 gitk:7436
msgid "Committer"
msgstr "Подаващ"
-#: gitk:2371
+#: gitk:2398
msgid "Search"
msgstr "Търсене"
-#: gitk:2379
+#: gitk:2406
msgid "Diff"
msgstr "Разлики"
-#: gitk:2381
+#: gitk:2408
msgid "Old version"
msgstr "Стара версия"
-#: gitk:2383
+#: gitk:2410
msgid "New version"
msgstr "Нова версия"
-#: gitk:2386
+#: gitk:2413
msgid "Lines of context"
msgstr "Контекст в редове"
-#: gitk:2396
+#: gitk:2423
msgid "Ignore space change"
msgstr "Празните знаци без значение"
-#: gitk:2400 gitk:2402 gitk:7983 gitk:8235
+#: gitk:2427 gitk:2429 gitk:8069 gitk:8321
msgid "Line diff"
msgstr "Поредови разлики"
-#: gitk:2467
+#: gitk:2502
msgid "Patch"
msgstr "Кръпка"
-#: gitk:2469
+#: gitk:2504
msgid "Tree"
msgstr "Дърво"
-#: gitk:2639 gitk:2660
+#: gitk:2674 gitk:2695
msgid "Diff this -> selected"
msgstr "Разлики между това и избраното"
-#: gitk:2640 gitk:2661
+#: gitk:2675 gitk:2696
msgid "Diff selected -> this"
msgstr "Разлики между избраното и това"
-#: gitk:2641 gitk:2662
+#: gitk:2676 gitk:2697
msgid "Make patch"
msgstr "Създаване на кръпка"
-#: gitk:2642 gitk:9283
+#: gitk:2677 gitk:9369
msgid "Create tag"
msgstr "Създаване на етикет"
-#: gitk:2643
-msgid "Copy commit summary"
-msgstr "Копиране на информацията за подаване"
+#: gitk:2678
+msgid "Copy commit reference"
+msgstr "Копиране на указателя на подаване"
-#: gitk:2644 gitk:9414
+#: gitk:2679 gitk:9500
msgid "Write commit to file"
msgstr "Запазване на подаването във файл"
-#: gitk:2645
+#: gitk:2680
msgid "Create new branch"
msgstr "Създаване на нов клон"
-#: gitk:2646
+#: gitk:2681
msgid "Cherry-pick this commit"
msgstr "Отбиране на това подаване"
-#: gitk:2647
+#: gitk:2682
msgid "Reset HEAD branch to here"
msgstr "Привеждане на върха на клона към текущото подаване"
-#: gitk:2648
+#: gitk:2683
msgid "Mark this commit"
msgstr "Отбелязване на това подаване"
-#: gitk:2649
+#: gitk:2684
msgid "Return to mark"
msgstr "Връщане към отбелязаното подаване"
-#: gitk:2650
+#: gitk:2685
msgid "Find descendant of this and mark"
msgstr "Откриване и отбелязване на наследниците"
-#: gitk:2651
+#: gitk:2686
msgid "Compare with marked commit"
msgstr "Сравнение с отбелязаното подаване"
-#: gitk:2652 gitk:2663
+#: gitk:2687 gitk:2698
msgid "Diff this -> marked commit"
msgstr "Разлики между това и отбелязаното"
-#: gitk:2653 gitk:2664
+#: gitk:2688 gitk:2699
msgid "Diff marked commit -> this"
msgstr "Разлики между отбелязаното и това"
-#: gitk:2654
+#: gitk:2689
msgid "Revert this commit"
msgstr "Отмяна на това подаване"
-#: gitk:2670
+#: gitk:2705
msgid "Check out this branch"
msgstr "Изтегляне на този клон"
-#: gitk:2671
+#: gitk:2706
msgid "Rename this branch"
msgstr "Преименуване на този клон"
-#: gitk:2672
+#: gitk:2707
msgid "Remove this branch"
msgstr "Изтриване на този клон"
-#: gitk:2673
+#: gitk:2708
msgid "Copy branch name"
msgstr "Копиране на името на клона"
-#: gitk:2680
+#: gitk:2715
msgid "Highlight this too"
msgstr "Отбелязване и на това"
-#: gitk:2681
+#: gitk:2716
msgid "Highlight this only"
msgstr "Отбелязване само на това"
-#: gitk:2682
+#: gitk:2717
msgid "External diff"
msgstr "Външна програма за разлики"
-#: gitk:2683
+#: gitk:2718
msgid "Blame parent commit"
msgstr "Анотиране на родителското подаване"
-#: gitk:2684
+#: gitk:2719
msgid "Copy path"
msgstr "Копиране на пътя"
-#: gitk:2691
+#: gitk:2726
msgid "Show origin of this line"
msgstr "Показване на произхода на този ред"
-#: gitk:2692
+#: gitk:2727
msgid "Run git gui blame on this line"
msgstr "Изпълнение на „git gui blame“ върху този ред"
-#: gitk:3036
+#: gitk:3081
msgid "About gitk"
msgstr "Относно gitk"
-#: gitk:3038
+#: gitk:3083
msgid ""
"\n"
"Gitk - a commit viewer for git\n"
@@ -386,324 +386,324 @@ msgstr ""
"\n"
"Използвайте и разпространявайте при условията на ОПЛ на ГНУ"
-#: gitk:3046 gitk:3113 gitk:10004
+#: gitk:3091 gitk:3158 gitk:10090
msgid "Close"
msgstr "Затваряне"
-#: gitk:3067
+#: gitk:3112
msgid "Gitk key bindings"
msgstr "Клавишни комбинации"
-#: gitk:3070
+#: gitk:3115
msgid "Gitk key bindings:"
msgstr "Клавишни комбинации:"
-#: gitk:3072
+#: gitk:3117
#, tcl-format
msgid "<%s-Q>\t\tQuit"
msgstr "<%s-Q>\t\tСпиране на програмата"
-#: gitk:3073
+#: gitk:3118
#, tcl-format
msgid "<%s-W>\t\tClose window"
msgstr "<%s-W>\t\tЗатваряне на прозореца"
-#: gitk:3074
+#: gitk:3119
msgid "<Home>\t\tMove to first commit"
msgstr "<Home>\t\tКъм първото подаване"
-#: gitk:3075
+#: gitk:3120
msgid "<End>\t\tMove to last commit"
msgstr "<End>\t\tКъм последното подаване"
-#: gitk:3076
+#: gitk:3121
msgid "<Up>, p, k\tMove up one commit"
msgstr "<Up>, p, k\tЕдно подаване нагоре"
-#: gitk:3077
+#: gitk:3122
msgid "<Down>, n, j\tMove down one commit"
msgstr "<Down>, n, j\tЕдно подаване надолу"
-#: gitk:3078
+#: gitk:3123
msgid "<Left>, z, h\tGo back in history list"
msgstr "<Left>, z, h\tНазад в историята"
-#: gitk:3079
+#: gitk:3124
msgid "<Right>, x, l\tGo forward in history list"
msgstr "<Right>, x, l\tНапред в историята"
-#: gitk:3080
+#: gitk:3125
#, tcl-format
msgid "<%s-n>\tGo to n-th parent of current commit in history list"
msgstr "<%s-n>\tКъм n-тия родител на текущото подаване в историята"
-#: gitk:3081
+#: gitk:3126
msgid "<PageUp>\tMove up one page in commit list"
msgstr "<PageUp>\tСтраница нагоре в списъка с подаванията"
-#: gitk:3082
+#: gitk:3127
msgid "<PageDown>\tMove down one page in commit list"
msgstr "<PageDown>\tСтраница надолу в списъка с подаванията"
-#: gitk:3083
+#: gitk:3128
#, tcl-format
msgid "<%s-Home>\tScroll to top of commit list"
msgstr "<%s-Home>\tКъм началото на списъка с подаванията"
-#: gitk:3084
+#: gitk:3129
#, tcl-format
msgid "<%s-End>\tScroll to bottom of commit list"
msgstr "<%s-End>\tКъм края на списъка с подаванията"
-#: gitk:3085
+#: gitk:3130
#, tcl-format
msgid "<%s-Up>\tScroll commit list up one line"
msgstr "<%s-Up>\tРед нагоре в списъка с подавания"
-#: gitk:3086
+#: gitk:3131
#, tcl-format
msgid "<%s-Down>\tScroll commit list down one line"
msgstr "<%s-Down>\tРед надолу в списъка с подавания"
-#: gitk:3087
+#: gitk:3132
#, tcl-format
msgid "<%s-PageUp>\tScroll commit list up one page"
msgstr "<%s-PageUp>\tСтраница нагоре в списъка с подавания"
-#: gitk:3088
+#: gitk:3133
#, tcl-format
msgid "<%s-PageDown>\tScroll commit list down one page"
msgstr "<%s-PageDown>\tСтраница надолу в списъка с подавания"
-#: gitk:3089
+#: gitk:3134
msgid "<Shift-Up>\tFind backwards (upwards, later commits)"
msgstr "<Shift-Up>\tТърсене назад (визуално нагоре, исторически — последващи)"
-#: gitk:3090
+#: gitk:3135
msgid "<Shift-Down>\tFind forwards (downwards, earlier commits)"
msgstr ""
"<Shift-Down>\tТърсене напред (визуално надолу, исторически — предхождащи)"
-#: gitk:3091
+#: gitk:3136
msgid "<Delete>, b\tScroll diff view up one page"
msgstr "<Delete>, b\tСтраница нагоре в изгледа за разлики"
-#: gitk:3092
+#: gitk:3137
msgid "<Backspace>\tScroll diff view up one page"
msgstr "<Backspace>\tСтраница надолу в изгледа за разлики"
-#: gitk:3093
+#: gitk:3138
msgid "<Space>\t\tScroll diff view down one page"
msgstr "<Space>\t\tСтраница надолу в изгледа за разлики"
-#: gitk:3094
+#: gitk:3139
msgid "u\t\tScroll diff view up 18 lines"
msgstr "u\t\t18 реда нагоре в изгледа за разлики"
-#: gitk:3095
+#: gitk:3140
msgid "d\t\tScroll diff view down 18 lines"
msgstr "d\t\t18 реда надолу в изгледа за разлики"
-#: gitk:3096
+#: gitk:3141
#, tcl-format
msgid "<%s-F>\t\tFind"
msgstr "<%s-F>\t\tТърсене"
-#: gitk:3097
+#: gitk:3142
#, tcl-format
msgid "<%s-G>\t\tMove to next find hit"
msgstr "<%s-G>\t\tКъм следващата поява"
-#: gitk:3098
+#: gitk:3143
msgid "<Return>\tMove to next find hit"
msgstr "<Return>\tКъм следващата поява"
-#: gitk:3099
+#: gitk:3144
msgid "g\t\tGo to commit"
msgstr "g\t\tКъм последното подаване"
-#: gitk:3100
+#: gitk:3145
msgid "/\t\tFocus the search box"
msgstr "/\t\tФокус върху полето за търсене"
-#: gitk:3101
+#: gitk:3146
msgid "?\t\tMove to previous find hit"
msgstr "?\t\tКъм предишната поява"
-#: gitk:3102
+#: gitk:3147
msgid "f\t\tScroll diff view to next file"
msgstr "f\t\tСледващ файл в изгледа за разлики"
-#: gitk:3103
+#: gitk:3148
#, tcl-format
msgid "<%s-S>\t\tSearch for next hit in diff view"
msgstr "<%s-S>\t\tТърсене на следващата поява в изгледа за разлики"
-#: gitk:3104
+#: gitk:3149
#, tcl-format
msgid "<%s-R>\t\tSearch for previous hit in diff view"
msgstr "<%s-R>\t\tТърсене на предишната поява в изгледа за разлики"
-#: gitk:3105
+#: gitk:3150
#, tcl-format
msgid "<%s-KP+>\tIncrease font size"
msgstr "<%s-KP+>\tПо-голям размер на шрифта"
-#: gitk:3106
+#: gitk:3151
#, tcl-format
msgid "<%s-plus>\tIncrease font size"
msgstr "<%s-plus>\tПо-голям размер на шрифта"
-#: gitk:3107
+#: gitk:3152
#, tcl-format
msgid "<%s-KP->\tDecrease font size"
msgstr "<%s-KP->\tПо-малък размер на шрифта"
-#: gitk:3108
+#: gitk:3153
#, tcl-format
msgid "<%s-minus>\tDecrease font size"
msgstr "<%s-minus>\tПо-малък размер на шрифта"
-#: gitk:3109
+#: gitk:3154
msgid "<F5>\t\tUpdate"
msgstr "<F5>\t\tОбновяване"
-#: gitk:3574 gitk:3583
+#: gitk:3621 gitk:3630
#, tcl-format
msgid "Error creating temporary directory %s:"
msgstr "Грешка при създаването на временната директория „%s“:"
-#: gitk:3596
+#: gitk:3643
#, tcl-format
msgid "Error getting \"%s\" from %s:"
msgstr "Грешка при получаването на „%s“ от %s:"
-#: gitk:3659
+#: gitk:3706
msgid "command failed:"
msgstr "неуспешно изпълнение на команда:"
-#: gitk:3808
+#: gitk:3855
msgid "No such commit"
msgstr "Такова подаване няма"
-#: gitk:3822
+#: gitk:3869
msgid "git gui blame: command failed:"
msgstr "„git gui blame“: неуспешно изпълнение на команда:"
-#: gitk:3853
+#: gitk:3900
#, tcl-format
msgid "Couldn't read merge head: %s"
-msgstr "Върхът за сливане не може да бъде прочетен: %s"
+msgstr "Върхът за сливане не може да се прочете: %s"
-#: gitk:3861
+#: gitk:3908
#, tcl-format
msgid "Error reading index: %s"
msgstr "Грешка при прочитане на индекса: %s"
-#: gitk:3886
+#: gitk:3933
#, tcl-format
msgid "Couldn't start git blame: %s"
-msgstr "Командата „git blame“ не може да бъде стартирана: %s"
+msgstr "Командата „git blame“ не може да се стартира: %s"
-#: gitk:3889 gitk:6778
+#: gitk:3936 gitk:6825
msgid "Searching"
msgstr "Търсене"
-#: gitk:3921
+#: gitk:3968
#, tcl-format
msgid "Error running git blame: %s"
msgstr "Грешка при изпълнението на „git blame“: %s"
-#: gitk:3949
+#: gitk:3996
#, tcl-format
msgid "That line comes from commit %s, which is not in this view"
msgstr "Този ред идва от подаването %s, което не е в изгледа"
-#: gitk:3963
+#: gitk:4010
msgid "External diff viewer failed:"
msgstr "Неуспешно изпълнение на външната програма за разлики:"
-#: gitk:4067
+#: gitk:4114
msgid "All files"
msgstr "Всички файлове"
-#: gitk:4091
+#: gitk:4138
msgid "View"
msgstr "Изглед"
-#: gitk:4094
+#: gitk:4141
msgid "Gitk view definition"
msgstr "Дефиниция на изглед в Gitk"
-#: gitk:4098
+#: gitk:4145
msgid "Remember this view"
msgstr "Запазване на този изглед"
-#: gitk:4099
+#: gitk:4146
msgid "References (space separated list):"
msgstr "Указатели (списък с разделител интервал):"
-#: gitk:4100
+#: gitk:4147
msgid "Branches & tags:"
msgstr "Клони и етикети:"
-#: gitk:4101
+#: gitk:4148
msgid "All refs"
msgstr "Всички указатели"
-#: gitk:4102
+#: gitk:4149
msgid "All (local) branches"
msgstr "Всички (локални) клони"
-#: gitk:4103
+#: gitk:4150
msgid "All tags"
msgstr "Всички етикети"
-#: gitk:4104
+#: gitk:4151
msgid "All remote-tracking branches"
msgstr "Всички следящи клони"
-#: gitk:4105
+#: gitk:4152
msgid "Commit Info (regular expressions):"
msgstr "Информация за подаване (рег. изр.):"
-#: gitk:4106
+#: gitk:4153
msgid "Author:"
msgstr "Автор:"
-#: gitk:4107
+#: gitk:4154
msgid "Committer:"
msgstr "Подал:"
-#: gitk:4108
+#: gitk:4155
msgid "Commit Message:"
msgstr "Съобщение при подаване:"
-#: gitk:4109
+#: gitk:4156
msgid "Matches all Commit Info criteria"
msgstr "Съвпадение по всички характеристики на подаването"
-#: gitk:4110
+#: gitk:4157
msgid "Matches no Commit Info criteria"
msgstr "Не съвпада по никоя от характеристиките на подаването"
-#: gitk:4111
+#: gitk:4158
msgid "Changes to Files:"
msgstr "Промени по файловете:"
-#: gitk:4112
+#: gitk:4159
msgid "Fixed String"
msgstr "Дословен низ"
-#: gitk:4113
+#: gitk:4160
msgid "Regular Expression"
msgstr "Регулярен израз"
-#: gitk:4114
+#: gitk:4161
msgid "Search string:"
msgstr "Низ за търсене:"
-#: gitk:4115
+#: gitk:4162
msgid ""
"Commit Dates (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 "
"15:27:38\"):"
@@ -711,204 +711,208 @@ msgstr ""
"Дата на подаване („2 weeks ago“ (преди 2 седмици), „2009-03-17 15:27:38“, "
"„March 17, 2009 15:27:38“):"
-#: gitk:4116
+#: gitk:4163
msgid "Since:"
msgstr "От:"
-#: gitk:4117
+#: gitk:4164
msgid "Until:"
msgstr "До:"
-#: gitk:4118
+#: gitk:4165
msgid "Limit and/or skip a number of revisions (positive integer):"
msgstr ""
"Ограничаване и/или прескачане на определен брой версии (неотрицателно цяло "
"число):"
-#: gitk:4119
+#: gitk:4166
msgid "Number to show:"
msgstr "Брой показани:"
-#: gitk:4120
+#: gitk:4167
msgid "Number to skip:"
msgstr "Брой прескочени:"
-#: gitk:4121
+#: gitk:4168
msgid "Miscellaneous options:"
msgstr "Разни:"
-#: gitk:4122
+#: gitk:4169
msgid "Strictly sort by date"
msgstr "Подреждане по дата"
-#: gitk:4123
+#: gitk:4170
msgid "Mark branch sides"
msgstr "Отбелязване на страните по клона"
-#: gitk:4124
+#: gitk:4171
msgid "Limit to first parent"
msgstr "Само първия родител"
-#: gitk:4125
+#: gitk:4172
msgid "Simple history"
msgstr "Опростена история"
-#: gitk:4126
+#: gitk:4173
msgid "Additional arguments to git log:"
msgstr "Допълнителни аргументи към „git log“:"
-#: gitk:4127
+#: gitk:4174
msgid "Enter files and directories to include, one per line:"
msgstr "Въведете файловете и директориите за включване, по елемент на ред"
-#: gitk:4128
+#: gitk:4175
msgid "Command to generate more commits to include:"
msgstr ""
-"Команда за генерирането на допълнителни подавания, които да бъдат включени:"
+"Команда за генерирането на допълнителни подавания, които да се включат:"
-#: gitk:4252
+#: gitk:4299
msgid "Gitk: edit view"
msgstr "Gitk: редактиране на изглед"
-#: gitk:4260
+#: gitk:4307
msgid "-- criteria for selecting revisions"
msgstr "— критерии за избор на версии"
-#: gitk:4265
+#: gitk:4312
msgid "View Name"
msgstr "Име на изглед"
-#: gitk:4340
+#: gitk:4387
msgid "Apply (F5)"
msgstr "Прилагане (F5)"
-#: gitk:4378
+#: gitk:4425
msgid "Error in commit selection arguments:"
msgstr "Грешка в аргументите за избор на подавания:"
-#: gitk:4433 gitk:4486 gitk:4948 gitk:4962 gitk:6232 gitk:12524 gitk:12525
+#: gitk:4480 gitk:4533 gitk:4995 gitk:5009 gitk:6279 gitk:12679 gitk:12680
msgid "None"
msgstr "Няма"
-#: gitk:5045 gitk:5050
+#: gitk:5092 gitk:5097
msgid "Descendant"
msgstr "Наследник"
-#: gitk:5046
+#: gitk:5093
msgid "Not descendant"
msgstr "Не е наследник"
-#: gitk:5053 gitk:5058
+#: gitk:5100 gitk:5105
msgid "Ancestor"
msgstr "Предшественик"
-#: gitk:5054
+#: gitk:5101
msgid "Not ancestor"
msgstr "Не е предшественик"
-#: gitk:5348
+#: gitk:5395
msgid "Local changes checked in to index but not committed"
msgstr "Локални промени добавени към индекса, но неподадени"
-#: gitk:5384
+#: gitk:5431
msgid "Local uncommitted changes, not checked in to index"
msgstr "Локални промени извън индекса"
-#: gitk:7158
+#: gitk:7179
+msgid "Error starting web browser:"
+msgstr "Грешка при стартирането на уеб браузър:"
+
+#: gitk:7240
msgid "and many more"
msgstr "и още много"
-#: gitk:7161
+#: gitk:7243
msgid "many"
msgstr "много"
-#: gitk:7352
+#: gitk:7438
msgid "Tags:"
msgstr "Етикети:"
-#: gitk:7369 gitk:7375 gitk:8854
+#: gitk:7455 gitk:7461 gitk:8940
msgid "Parent"
msgstr "Родител"
-#: gitk:7380
+#: gitk:7466
msgid "Child"
msgstr "Дете"
-#: gitk:7389
+#: gitk:7475
msgid "Branch"
msgstr "Клон"
-#: gitk:7392
+#: gitk:7478
msgid "Follows"
msgstr "Следва"
-#: gitk:7395
+#: gitk:7481
msgid "Precedes"
msgstr "Предшества"
-#: gitk:7990
+#: gitk:8076
#, tcl-format
msgid "Error getting diffs: %s"
msgstr "Грешка при получаването на разликите: %s"
-#: gitk:8679
+#: gitk:8765
msgid "Goto:"
msgstr "Към ред:"
-#: gitk:8700
+#: gitk:8786
#, tcl-format
-msgid "Short SHA1 id %s is ambiguous"
-msgstr "Съкратената сума по SHA1 %s не е еднозначна"
+msgid "Short commit ID %s is ambiguous"
+msgstr "Съкратената контролна сума %s не е еднозначна"
-#: gitk:8707
+#: gitk:8793
#, tcl-format
msgid "Revision %s is not known"
msgstr "Непозната версия %s"
-#: gitk:8717
+#: gitk:8803
#, tcl-format
-msgid "SHA1 id %s is not known"
-msgstr "Непозната сума по SHA1 %s"
+msgid "Commit ID %s is not known"
+msgstr "Непозната контролна сума %s"
-#: gitk:8719
+#: gitk:8805
#, tcl-format
msgid "Revision %s is not in the current view"
msgstr "Версия %s не е в текущия изглед"
-#: gitk:8861 gitk:8876
+#: gitk:8947 gitk:8962
msgid "Date"
msgstr "Дата"
-#: gitk:8864
+#: gitk:8950
msgid "Children"
msgstr "Деца"
-#: gitk:8927
+#: gitk:9013
#, tcl-format
msgid "Reset %s branch to here"
msgstr "Зануляване на клона „%s“ към текущото подаване"
-#: gitk:8929
+#: gitk:9015
msgid "Detached head: can't reset"
msgstr "Несвързан връх: невъзможно зануляване"
-#: gitk:9034 gitk:9040
+#: gitk:9120 gitk:9126
msgid "Skipping merge commit "
msgstr "Пропускане на подаването на сливането"
-#: gitk:9049 gitk:9054
+#: gitk:9135 gitk:9140
msgid "Error getting patch ID for "
msgstr "Грешка при получаването на идентификатора на "
-#: gitk:9050 gitk:9055
+#: gitk:9136 gitk:9141
msgid " - stopping\n"
msgstr " — спиране\n"
-#: gitk:9060 gitk:9063 gitk:9071 gitk:9085 gitk:9094
+#: gitk:9146 gitk:9149 gitk:9157 gitk:9171 gitk:9180
msgid "Commit "
msgstr "Подаване"
-#: gitk:9064
+#: gitk:9150
msgid ""
" is the same patch as\n"
" "
@@ -916,7 +920,7 @@ msgstr ""
" е същата кръпка като\n"
" "
-#: gitk:9072
+#: gitk:9158
msgid ""
" differs from\n"
" "
@@ -924,7 +928,7 @@ msgstr ""
" се различава от\n"
" "
-#: gitk:9074
+#: gitk:9160
msgid ""
"Diff of commits:\n"
"\n"
@@ -932,147 +936,147 @@ msgstr ""
"Разлика между подаванията:\n"
"\n"
-#: gitk:9086 gitk:9095
+#: gitk:9172 gitk:9181
#, tcl-format
msgid " has %s children - stopping\n"
msgstr " има %s деца — спиране\n"
-#: gitk:9114
+#: gitk:9200
#, tcl-format
msgid "Error writing commit to file: %s"
msgstr "Грешка при запазването на подаването във файл: %s"
-#: gitk:9120
+#: gitk:9206
#, tcl-format
msgid "Error diffing commits: %s"
msgstr "Грешка при изчисляването на разликите между подаванията: %s"
-#: gitk:9166
+#: gitk:9252
msgid "Top"
msgstr "Най-горе"
-#: gitk:9167
+#: gitk:9253
msgid "From"
msgstr "От"
-#: gitk:9172
+#: gitk:9258
msgid "To"
msgstr "До"
-#: gitk:9196
+#: gitk:9282
msgid "Generate patch"
msgstr "Генериране на кръпка"
-#: gitk:9198
+#: gitk:9284
msgid "From:"
msgstr "От:"
-#: gitk:9207
+#: gitk:9293
msgid "To:"
msgstr "До:"
-#: gitk:9216
+#: gitk:9302
msgid "Reverse"
msgstr "Обръщане"
-#: gitk:9218 gitk:9428
+#: gitk:9304 gitk:9514
msgid "Output file:"
msgstr "Запазване във файла:"
-#: gitk:9224
+#: gitk:9310
msgid "Generate"
msgstr "Генериране"
-#: gitk:9262
+#: gitk:9348
msgid "Error creating patch:"
msgstr "Грешка при създаването на кръпка:"
-#: gitk:9285 gitk:9416 gitk:9504
+#: gitk:9371 gitk:9502 gitk:9590
msgid "ID:"
msgstr "Идентификатор:"
-#: gitk:9294
+#: gitk:9380
msgid "Tag name:"
msgstr "Име на етикет:"
-#: gitk:9297
+#: gitk:9383
msgid "Tag message is optional"
msgstr "Съобщението за етикет е незадължително"
-#: gitk:9299
+#: gitk:9385
msgid "Tag message:"
msgstr "Съобщение за етикет:"
-#: gitk:9303 gitk:9474
+#: gitk:9389 gitk:9560
msgid "Create"
msgstr "Създаване"
-#: gitk:9321
+#: gitk:9407
msgid "No tag name specified"
msgstr "Липсва име на етикет"
-#: gitk:9325
+#: gitk:9411
#, tcl-format
msgid "Tag \"%s\" already exists"
msgstr "Етикетът „%s“ вече съществува"
-#: gitk:9335
+#: gitk:9421
msgid "Error creating tag:"
msgstr "Грешка при създаването на етикет:"
-#: gitk:9425
+#: gitk:9511
msgid "Command:"
msgstr "Команда:"
-#: gitk:9433
+#: gitk:9519
msgid "Write"
msgstr "Запазване"
-#: gitk:9451
+#: gitk:9537
msgid "Error writing commit:"
msgstr "Грешка при запазването на подаването:"
-#: gitk:9473
+#: gitk:9559
msgid "Create branch"
msgstr "Създаване на клон"
-#: gitk:9489
+#: gitk:9575
#, tcl-format
msgid "Rename branch %s"
msgstr "Преименуване на клона „%s“"
-#: gitk:9490
+#: gitk:9576
msgid "Rename"
msgstr "Преименуване"
-#: gitk:9514
+#: gitk:9600
msgid "Name:"
msgstr "Име:"
-#: gitk:9538
+#: gitk:9624
msgid "Please specify a name for the new branch"
msgstr "Укажете име за новия клон"
-#: gitk:9543
+#: gitk:9629
#, tcl-format
msgid "Branch '%s' already exists. Overwrite?"
-msgstr "Клонът „%s“ вече съществува. Да бъде ли презаписан?"
+msgstr "Клонът „%s“ вече съществува. Да се презапише ли?"
-#: gitk:9587
+#: gitk:9673
msgid "Please specify a new name for the branch"
msgstr "Укажете ново име за клона"
-#: gitk:9650
+#: gitk:9736
#, tcl-format
msgid "Commit %s is already included in branch %s -- really re-apply it?"
msgstr ""
-"Подаването „%s“ вече е включено в клона „%s“ — да бъде ли приложено отново?"
+"Подаването „%s“ вече е включено в клона „%s“ — да се приложи ли отново?"
-#: gitk:9655
+#: gitk:9741
msgid "Cherry-picking"
msgstr "Отбиране"
-#: gitk:9664
+#: gitk:9750
#, tcl-format
msgid ""
"Cherry-pick failed because of local changes to file '%s'.\n"
@@ -1081,7 +1085,7 @@ msgstr ""
"Неуспешно отбиране, защото във файла „%s“ има локални промени.\n"
"Подайте, занулете или ги скатайте и пробвайте отново."
-#: gitk:9670
+#: gitk:9756
msgid ""
"Cherry-pick failed because of merge conflict.\n"
"Do you wish to run git citool to resolve it?"
@@ -1089,20 +1093,20 @@ msgstr ""
"Неуспешно отбиране поради конфликти при сливане.\n"
"Искате ли да ги коригирате чрез „git citool“?"
-#: gitk:9686 gitk:9744
+#: gitk:9772 gitk:9830
msgid "No changes committed"
msgstr "Не са подадени промени"
-#: gitk:9713
+#: gitk:9799
#, tcl-format
msgid "Commit %s is not included in branch %s -- really revert it?"
-msgstr "Подаването „%s“ не е включено в клона „%s“. Да бъде ли отменено?"
+msgstr "Подаването „%s“ не е включено в клона „%s“. Да се отменени ли?"
-#: gitk:9718
+#: gitk:9804
msgid "Reverting"
msgstr "Отмяна"
-#: gitk:9726
+#: gitk:9812
#, tcl-format
msgid ""
"Revert failed because of local changes to the following files:%s Please "
@@ -1111,7 +1115,7 @@ msgstr ""
"Неуспешна отмяна, защото във файла „%s“ има локални промени.\n"
"Подайте, занулете или ги скатайте и пробвайте отново."
-#: gitk:9730
+#: gitk:9816
msgid ""
"Revert failed because of merge conflict.\n"
" Do you wish to run git citool to resolve it?"
@@ -1119,53 +1123,53 @@ msgstr ""
"Неуспешно отмяна поради конфликти при сливане.\n"
"Искате ли да ги коригирате чрез „git citool“?"
-#: gitk:9773
+#: gitk:9859
msgid "Confirm reset"
msgstr "Потвърждаване на зануляването"
-#: gitk:9775
+#: gitk:9861
#, tcl-format
msgid "Reset branch %s to %s?"
msgstr "Да се занули ли клонът „%s“ към „%s“?"
-#: gitk:9777
+#: gitk:9863
msgid "Reset type:"
msgstr "Вид зануляване:"
-#: gitk:9780
+#: gitk:9866
msgid "Soft: Leave working tree and index untouched"
msgstr "Слабо: работното дърво и индекса остават същите"
-#: gitk:9783
+#: gitk:9869
msgid "Mixed: Leave working tree untouched, reset index"
msgstr "Смесено: работното дърво остава същото, индексът се занулява"
-#: gitk:9786
+#: gitk:9872
msgid ""
"Hard: Reset working tree and index\n"
"(discard ALL local changes)"
msgstr ""
"Силно: зануляване и на работното дърво, и на индекса\n"
-"(ВСИЧКИ локални промени ще бъдат безвъзвратно загубени)"
+"(ВСИЧКИ локални промени ще се загубят безвъзвратно)"
-#: gitk:9803
+#: gitk:9889
msgid "Resetting"
msgstr "Зануляване"
-#: gitk:9876
+#: gitk:9962
#, tcl-format
msgid "A local branch named %s exists already"
msgstr "Вече съществува локален клон „%s“."
-#: gitk:9884
+#: gitk:9970
msgid "Checking out"
msgstr "Изтегляне"
-#: gitk:9943
+#: gitk:10029
msgid "Cannot delete the currently checked-out branch"
-msgstr "Текущо изтегленият клон не може да бъде изтрит"
+msgstr "Текущо изтегленият клон не може да се изтрие"
-#: gitk:9949
+#: gitk:10035
#, tcl-format
msgid ""
"The commits on branch %s aren't on any other branch.\n"
@@ -1174,16 +1178,16 @@ msgstr ""
"Подаванията на клона „%s“ не са на никой друг клон.\n"
"Наистина ли искате да изтриете клона „%s“?"
-#: gitk:9980
+#: gitk:10066
#, tcl-format
msgid "Tags and heads: %s"
msgstr "Етикети и върхове: %s"
-#: gitk:9997
+#: gitk:10083
msgid "Filter"
msgstr "Филтриране"
-#: gitk:10293
+#: gitk:10390
msgid ""
"Error reading commit topology information; branch and preceding/following "
"tag information will be incomplete."
@@ -1191,201 +1195,237 @@ msgstr ""
"Грешка при прочитането на топологията на подаванията. Информацията за клона "
"и предшестващите/следващите етикети ще е непълна."
-#: gitk:11270
+#: gitk:11367
msgid "Tag"
msgstr "Етикет"
-#: gitk:11274
+#: gitk:11371
msgid "Id"
msgstr "Идентификатор"
-#: gitk:11357
+#: gitk:11454
msgid "Gitk font chooser"
msgstr "Избор на шрифт за Gitk"
-#: gitk:11374
+#: gitk:11471
msgid "B"
msgstr "Ч"
-#: gitk:11377
+#: gitk:11474
msgid "I"
msgstr "К"
-#: gitk:11495
+#: gitk:11593
msgid "Commit list display options"
msgstr "Настройки на списъка с подавания"
-#: gitk:11498
+#: gitk:11596
msgid "Maximum graph width (lines)"
msgstr "Максимална широчина на графа (в редове)"
-#: gitk:11502
+#: gitk:11600
#, no-tcl-format
msgid "Maximum graph width (% of pane)"
msgstr "Максимална широчина на графа (% от панела)"
-#: gitk:11505
+#: gitk:11603
msgid "Show local changes"
msgstr "Показване на локалните промени"
-#: gitk:11508
-msgid "Auto-select SHA1 (length)"
-msgstr "Автоматично избиране на SHA1 (дължина)"
-
-#: gitk:11512
+#: gitk:11606
msgid "Hide remote refs"
msgstr "Скриване на отдалечените указатели"
-#: gitk:11516
+#: gitk:11610
+msgid "Copy commit ID to clipboard"
+msgstr "Копиране на контролната сума към буфера за обмен"
+
+#: gitk:11614
+msgid "Copy commit ID to X11 selection"
+msgstr "Копиране на контролната сума в селекцията на X11"
+
+#: gitk:11619
+msgid "Length of commit ID to copy"
+msgstr "Дължина на контролната сума, която се копира"
+
+#: gitk:11622
msgid "Diff display options"
msgstr "Настройки на показването на разликите"
-#: gitk:11518
+#: gitk:11624
msgid "Tab spacing"
msgstr "Широчина на табулатора"
-#: gitk:11521
+#: gitk:11628
+msgid "Wrap comment text"
+msgstr "Пренасяне на думите в коментарите"
+
+#: gitk:11633
+msgid "Wrap other text"
+msgstr "Пренасяне на другия текст"
+
+#: gitk:11638
msgid "Display nearby tags/heads"
msgstr "Извеждане на близките етикети и върхове"
-#: gitk:11524
+#: gitk:11641
msgid "Maximum # tags/heads to show"
msgstr "Максимален брой етикети/върхове за показване"
-#: gitk:11527
+#: gitk:11644
msgid "Limit diffs to listed paths"
msgstr "Разлика само в избраните пътища"
-#: gitk:11530
+#: gitk:11647
msgid "Support per-file encodings"
msgstr "Поддръжка на различни кодирания за всеки файл"
-#: gitk:11536 gitk:11683
+#: gitk:11653 gitk:11820
msgid "External diff tool"
msgstr "Външен инструмент за разлики"
-#: gitk:11537
+#: gitk:11654
msgid "Choose..."
msgstr "Избор…"
-#: gitk:11542
+#: gitk:11661
+msgid "Web browser"
+msgstr "Уеб браузър"
+
+#: gitk:11666
msgid "General options"
msgstr "Общи настройки"
-#: gitk:11545
+#: gitk:11669
msgid "Use themed widgets"
msgstr "Използване на тема за графичните обекти"
-#: gitk:11547
+#: gitk:11671
msgid "(change requires restart)"
msgstr "(промяната изисква рестартиране на Gitk)"
-#: gitk:11549
+#: gitk:11673
msgid "(currently unavailable)"
msgstr "(в момента недостъпно)"
-#: gitk:11560
+#: gitk:11685
msgid "Colors: press to choose"
msgstr "Цветове: избира се с натискане"
-#: gitk:11563
+#: gitk:11688
msgid "Interface"
msgstr "Интерфейс"
-#: gitk:11564
+#: gitk:11689
msgid "interface"
msgstr "интерфейс"
-#: gitk:11567
+#: gitk:11692
msgid "Background"
msgstr "Фон"
-#: gitk:11568 gitk:11598
+#: gitk:11693 gitk:11735
msgid "background"
msgstr "фон"
-#: gitk:11571
+#: gitk:11696
msgid "Foreground"
msgstr "Знаци"
-#: gitk:11572
+#: gitk:11697
msgid "foreground"
msgstr "знаци"
-#: gitk:11575
+#: gitk:11700
msgid "Diff: old lines"
msgstr "Разлика: стари редове"
-#: gitk:11576
+#: gitk:11701
msgid "diff old lines"
msgstr "разлика, стари редове"
-#: gitk:11580
+#: gitk:11705
+msgid "Diff: old lines bg"
+msgstr "Разлика: фон на стари редове"
+
+#: gitk:11707
+msgid "diff old lines bg"
+msgstr "разлика, фон на стари редове"
+
+#: gitk:11711
msgid "Diff: new lines"
msgstr "Разлика: нови редове"
-#: gitk:11581
+#: gitk:11712
msgid "diff new lines"
msgstr "разлика, нови редове"
-#: gitk:11585
+#: gitk:11716
+msgid "Diff: new lines bg"
+msgstr "Разлика: фон на нови редове"
+
+#: gitk:11718
+msgid "diff new lines bg"
+msgstr "разлика, фон на нови редове"
+
+#: gitk:11722
msgid "Diff: hunk header"
msgstr "Разлика: начало на парче"
-#: gitk:11587
+#: gitk:11724
msgid "diff hunk header"
msgstr "разлика, начало на парче"
-#: gitk:11591
+#: gitk:11728
msgid "Marked line bg"
msgstr "Фон на отбелязан ред"
-#: gitk:11593
+#: gitk:11730
msgid "marked line background"
msgstr "фон на отбелязан ред"
-#: gitk:11597
+#: gitk:11734
msgid "Select bg"
msgstr "Избор на фон"
-#: gitk:11606
+#: gitk:11743
msgid "Fonts: press to choose"
msgstr "Шрифтове: избира се с натискане"
-#: gitk:11608
+#: gitk:11745
msgid "Main font"
msgstr "Основен шрифт"
-#: gitk:11609
+#: gitk:11746
msgid "Diff display font"
msgstr "Шрифт за разликите"
-#: gitk:11610
+#: gitk:11747
msgid "User interface font"
msgstr "Шрифт на интерфейса"
-#: gitk:11632
+#: gitk:11769
msgid "Gitk preferences"
msgstr "Настройки на Gitk"
-#: gitk:11641
+#: gitk:11778
msgid "General"
msgstr "Общи"
-#: gitk:11642
+#: gitk:11779
msgid "Colors"
msgstr "Цветове"
-#: gitk:11643
+#: gitk:11780
msgid "Fonts"
msgstr "Шрифтове"
-#: gitk:11693
+#: gitk:11830
#, tcl-format
msgid "Gitk: choose color for %s"
msgstr "Gitk: избор на цвят на „%s“"
-#: gitk:12206
+#: gitk:12350
msgid ""
"Sorry, gitk cannot run with this version of Tcl/Tk.\n"
" Gitk requires at least Tcl/Tk 8.4."
@@ -1393,15 +1433,15 @@ msgstr ""
"Тази версия на Tcl/Tk не се поддържа от Gitk.\n"
" Необходима ви е поне Tcl/Tk 8.4."
-#: gitk:12416
+#: gitk:12571
msgid "Cannot find a git repository here."
msgstr "Тук липсва хранилище на Git."
-#: gitk:12463
+#: gitk:12618
#, tcl-format
msgid "Ambiguous argument '%s': both revision and filename"
msgstr "Нееднозначен аргумент „%s“: има и такава версия, и такъв файл"
-#: gitk:12475
+#: gitk:12630
msgid "Bad arguments to gitk:"
msgstr "Неправилни аргументи на gitk:"
diff --git a/gitk-git/po/sv.po b/gitk-git/po/sv.po
index 2a06fe5bbc..5afbe6da1d 100644
--- a/gitk-git/po/sv.po
+++ b/gitk-git/po/sv.po
@@ -3,14 +3,14 @@
# This file is distributed under the same license as the gitk package.
#
# Mikael Magnusson <mikachu@gmail.com>, 2008.
-# Peter Krefting <peter@softwolves.pp.se>, 2008, 2009, 2010, 2012, 2013, 2015.
+# Peter Krefting <peter@softwolves.pp.se>, 2008-2023.
#
msgid ""
msgstr ""
"Project-Id-Version: sv\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-12-09 09:40+0100\n"
-"PO-Revision-Date: 2015-12-11 09:46+0100\n"
+"POT-Creation-Date: 2023-10-26 21:39+0100\n"
+"PO-Revision-Date: 2023-10-26 21:42+0100\n"
"Last-Translator: Peter Krefting <peter@softwolves.pp.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
@@ -18,35 +18,35 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Gtranslator 2.91.6\n"
+"X-Generator: Gtranslator 3.38.0\n"
-#: gitk:140
+#: gitk:139
msgid "Couldn't get list of unmerged files:"
msgstr "Kunde inte hämta lista över ej sammanslagna filer:"
-#: gitk:212 gitk:2381
+#: gitk:211 gitk:2406
msgid "Color words"
msgstr "Färga ord"
-#: gitk:217 gitk:2381 gitk:8221 gitk:8254
+#: gitk:216 gitk:2406 gitk:8307 gitk:8340
msgid "Markup words"
msgstr "Märk upp ord"
-#: gitk:324
+#: gitk:323
msgid "Error parsing revisions:"
msgstr "Fel vid tolkning av revisioner:"
-#: gitk:380
+#: gitk:379
msgid "Error executing --argscmd command:"
msgstr "Fel vid körning av --argscmd-kommando:"
-#: gitk:393
+#: gitk:392
msgid "No files selected: --merge specified but no files are unmerged."
msgstr ""
"Inga filer valdes: --merge angavs men det finns inga filer som inte har "
"slagits samman."
-#: gitk:396
+#: gitk:395
msgid ""
"No files selected: --merge specified but no unmerged files are within file "
"limit."
@@ -54,322 +54,326 @@ msgstr ""
"Inga filer valdes: --merge angavs men det finns inga filer inom "
"filbegränsningen."
-#: gitk:418 gitk:566
+#: gitk:417 gitk:565
msgid "Error executing git log:"
msgstr "Fel vid körning av git log:"
-#: gitk:436 gitk:582
+#: gitk:435 gitk:581
msgid "Reading"
msgstr "Läser"
-#: gitk:496 gitk:4526
+#: gitk:495 gitk:4572
msgid "Reading commits..."
msgstr "Läser incheckningar..."
-#: gitk:499 gitk:1637 gitk:4529
+#: gitk:498 gitk:1640 gitk:4575
msgid "No commits selected"
msgstr "Inga incheckningar markerade"
-#: gitk:1445 gitk:4046 gitk:12447
+#: gitk:1448 gitk:4092 gitk:12674
msgid "Command line"
msgstr "Kommandorad"
-#: gitk:1511
+#: gitk:1514
msgid "Can't parse git log output:"
msgstr "Kan inte tolka utdata från git log:"
-#: gitk:1740
+#: gitk:1743
msgid "No commit information available"
msgstr "Ingen incheckningsinformation är tillgänglig"
-#: gitk:1903 gitk:1932 gitk:4316 gitk:9684 gitk:11256 gitk:11536
+#: gitk:1910 gitk:1939 gitk:4362 gitk:9847 gitk:11451 gitk:11751
msgid "OK"
msgstr "OK"
-#: gitk:1934 gitk:4318 gitk:9197 gitk:9276 gitk:9406 gitk:9455 gitk:9686
-#: gitk:11257 gitk:11537
+#: gitk:1941 gitk:4364 gitk:9283 gitk:9362 gitk:9492 gitk:9578 gitk:9849
+#: gitk:11452 gitk:11752
msgid "Cancel"
msgstr "Avbryt"
-#: gitk:2069
+#: gitk:2090
msgid "&Update"
msgstr "&Uppdatera"
-#: gitk:2070
+#: gitk:2091
msgid "&Reload"
msgstr "Läs &om"
-#: gitk:2071
+#: gitk:2092
msgid "Reread re&ferences"
msgstr "Läs om &referenser"
-#: gitk:2072
+#: gitk:2093
msgid "&List references"
msgstr "&Visa referenser"
-#: gitk:2074
+#: gitk:2095
msgid "Start git &gui"
msgstr "Starta git &gui"
-#: gitk:2076
+#: gitk:2097
msgid "&Quit"
msgstr "&Avsluta"
-#: gitk:2068
+#: gitk:2089
msgid "&File"
msgstr "&Arkiv"
-#: gitk:2080
+#: gitk:2101
msgid "&Preferences"
msgstr "&Inställningar"
-#: gitk:2079
+#: gitk:2100
msgid "&Edit"
msgstr "&Redigera"
-#: gitk:2084
+#: gitk:2105
msgid "&New view..."
msgstr "&Ny vy..."
-#: gitk:2085
+#: gitk:2106
msgid "&Edit view..."
msgstr "&Ändra vy..."
-#: gitk:2086
+#: gitk:2107
msgid "&Delete view"
msgstr "&Ta bort vy"
-#: gitk:2088
+#: gitk:2109
msgid "&All files"
msgstr "&Alla filer"
-#: gitk:2083
+#: gitk:2104
msgid "&View"
msgstr "&Visa"
-#: gitk:2093 gitk:2103
+#: gitk:2114 gitk:2124
msgid "&About gitk"
msgstr "&Om gitk"
-#: gitk:2094 gitk:2108
+#: gitk:2115 gitk:2129
msgid "&Key bindings"
msgstr "&Tangentbordsbindningar"
-#: gitk:2092 gitk:2107
+#: gitk:2113 gitk:2128
msgid "&Help"
msgstr "&Hjälp"
-#: gitk:2185 gitk:8653
+#: gitk:2206 gitk:8739
msgid "SHA1 ID:"
msgstr "SHA1-id:"
-#: gitk:2229
+#: gitk:2250
msgid "Row"
msgstr "Rad"
-#: gitk:2267
+#: gitk:2288
msgid "Find"
msgstr "Sök"
-#: gitk:2295
+#: gitk:2316
msgid "commit"
msgstr "incheckning"
-#: gitk:2299 gitk:2301 gitk:4688 gitk:4711 gitk:4735 gitk:6756 gitk:6828
-#: gitk:6913
+#: gitk:2320 gitk:2322 gitk:4734 gitk:4757 gitk:4781 gitk:6802 gitk:6874
+#: gitk:6959
msgid "containing:"
msgstr "som innehåller:"
-#: gitk:2302 gitk:3527 gitk:3532 gitk:4764
+#: gitk:2323 gitk:3573 gitk:3578 gitk:4810
msgid "touching paths:"
msgstr "som rör sökväg:"
-#: gitk:2303 gitk:4778
+#: gitk:2324 gitk:4824
msgid "adding/removing string:"
msgstr "som lägger/till tar bort sträng:"
-#: gitk:2304 gitk:4780
+#: gitk:2325 gitk:4826
msgid "changing lines matching:"
msgstr "ändrar rader som matchar:"
-#: gitk:2313 gitk:2315 gitk:4767
+#: gitk:2334 gitk:2336 gitk:4813
msgid "Exact"
msgstr "Exakt"
-#: gitk:2315 gitk:4855 gitk:6724
+#: gitk:2336 gitk:4901 gitk:6770
msgid "IgnCase"
msgstr "IgnVersaler"
-#: gitk:2315 gitk:4737 gitk:4853 gitk:6720
+#: gitk:2336 gitk:4783 gitk:4899 gitk:6766
msgid "Regexp"
msgstr "Reg.uttr."
-#: gitk:2317 gitk:2318 gitk:4875 gitk:4905 gitk:4912 gitk:6849 gitk:6917
+#: gitk:2338 gitk:2339 gitk:4921 gitk:4951 gitk:4958 gitk:6895 gitk:6963
msgid "All fields"
msgstr "Alla fält"
-#: gitk:2318 gitk:4872 gitk:4905 gitk:6787
+#: gitk:2339 gitk:4918 gitk:4951 gitk:6833
msgid "Headline"
msgstr "Rubrik"
-#: gitk:2319 gitk:4872 gitk:6787 gitk:6917 gitk:7390
+#: gitk:2340 gitk:4918 gitk:6833 gitk:6963 gitk:7471
msgid "Comments"
msgstr "Kommentarer"
-#: gitk:2319 gitk:4872 gitk:4877 gitk:4912 gitk:6787 gitk:7325 gitk:8831
-#: gitk:8846
+#: gitk:2340 gitk:4918 gitk:4923 gitk:4958 gitk:6833 gitk:7406 gitk:8917
+#: gitk:8932
msgid "Author"
msgstr "Författare"
-#: gitk:2319 gitk:4872 gitk:6787 gitk:7327
+#: gitk:2340 gitk:4918 gitk:6833 gitk:7408
msgid "Committer"
msgstr "Incheckare"
-#: gitk:2350
+#: gitk:2374
msgid "Search"
msgstr "Sök"
-#: gitk:2358
+#: gitk:2382
msgid "Diff"
msgstr "Diff"
-#: gitk:2360
+#: gitk:2384
msgid "Old version"
msgstr "Gammal version"
-#: gitk:2362
+#: gitk:2386
msgid "New version"
msgstr "Ny version"
-#: gitk:2364
+#: gitk:2389
msgid "Lines of context"
msgstr "Rader sammanhang"
-#: gitk:2374
+#: gitk:2399
msgid "Ignore space change"
msgstr "Ignorera ändringar i blanksteg"
-#: gitk:2378 gitk:2380 gitk:7960 gitk:8207
+#: gitk:2403 gitk:2405 gitk:8041 gitk:8293
msgid "Line diff"
msgstr "Rad-diff"
-#: gitk:2445
+#: gitk:2478
msgid "Patch"
msgstr "Patch"
-#: gitk:2447
+#: gitk:2480
msgid "Tree"
msgstr "Träd"
-#: gitk:2617 gitk:2638
+#: gitk:2650 gitk:2671
msgid "Diff this -> selected"
msgstr "Diff denna -> markerad"
-#: gitk:2618 gitk:2639
+#: gitk:2651 gitk:2672
msgid "Diff selected -> this"
msgstr "Diff markerad -> denna"
-#: gitk:2619 gitk:2640
+#: gitk:2652 gitk:2673
msgid "Make patch"
msgstr "Skapa patch"
-#: gitk:2620 gitk:9255
+#: gitk:2653 gitk:9341
msgid "Create tag"
msgstr "Skapa tagg"
-#: gitk:2621
-msgid "Copy commit summary"
-msgstr "Kopiera incheckningssammanfattning"
+#: gitk:2654
+msgid "Copy commit reference"
+msgstr "Kopiera incheckningsreferens"
-#: gitk:2622 gitk:9386
+#: gitk:2655 gitk:9472
msgid "Write commit to file"
msgstr "Skriv incheckning till fil"
-#: gitk:2623 gitk:9443
+#: gitk:2656
msgid "Create new branch"
msgstr "Skapa ny gren"
-#: gitk:2624
+#: gitk:2657
msgid "Cherry-pick this commit"
msgstr "Plocka denna incheckning"
-#: gitk:2625
+#: gitk:2658
msgid "Reset HEAD branch to here"
msgstr "Återställ HEAD-grenen hit"
-#: gitk:2626
+#: gitk:2659
msgid "Mark this commit"
msgstr "Markera denna incheckning"
-#: gitk:2627
+#: gitk:2660
msgid "Return to mark"
msgstr "Återgå till markering"
-#: gitk:2628
+#: gitk:2661
msgid "Find descendant of this and mark"
msgstr "Hitta efterföljare till denna och markera"
-#: gitk:2629
+#: gitk:2662
msgid "Compare with marked commit"
msgstr "Jämför med markerad incheckning"
-#: gitk:2630 gitk:2641
+#: gitk:2663 gitk:2674
msgid "Diff this -> marked commit"
msgstr "Diff denna -> markerad incheckning"
-#: gitk:2631 gitk:2642
+#: gitk:2664 gitk:2675
msgid "Diff marked commit -> this"
msgstr "Diff markerad incheckning -> denna"
-#: gitk:2632
+#: gitk:2665
msgid "Revert this commit"
msgstr "Ångra denna incheckning"
-#: gitk:2648
+#: gitk:2681
msgid "Check out this branch"
msgstr "Checka ut denna gren"
-#: gitk:2649
+#: gitk:2682
+msgid "Rename this branch"
+msgstr "Byt namn på denna gren"
+
+#: gitk:2683
msgid "Remove this branch"
msgstr "Ta bort denna gren"
-#: gitk:2650
+#: gitk:2684
msgid "Copy branch name"
msgstr "Kopiera namn på gren"
-#: gitk:2657
+#: gitk:2691
msgid "Highlight this too"
msgstr "Markera även detta"
-#: gitk:2658
+#: gitk:2692
msgid "Highlight this only"
msgstr "Markera bara detta"
-#: gitk:2659
+#: gitk:2693
msgid "External diff"
msgstr "Extern diff"
-#: gitk:2660
+#: gitk:2694
msgid "Blame parent commit"
msgstr "Klandra föräldraincheckning"
-#: gitk:2661
+#: gitk:2695
msgid "Copy path"
msgstr "Kopiera sökväg"
-#: gitk:2668
+#: gitk:2702
msgid "Show origin of this line"
msgstr "Visa ursprunget för den här raden"
-#: gitk:2669
+#: gitk:2703
msgid "Run git gui blame on this line"
msgstr "Kör git gui blame på den här raden"
-#: gitk:3013
+#: gitk:3057
msgid "About gitk"
msgstr "Om gitk"
-#: gitk:3015
+#: gitk:3059
msgid ""
"\n"
"Gitk - a commit viewer for git\n"
@@ -385,525 +389,529 @@ msgstr ""
"\n"
"Använd och vidareförmedla enligt villkoren i GNU General Public License"
-#: gitk:3023 gitk:3090 gitk:9872
+#: gitk:3067 gitk:3134 gitk:10062
msgid "Close"
msgstr "Stäng"
-#: gitk:3044
+#: gitk:3088
msgid "Gitk key bindings"
msgstr "Tangentbordsbindningar för Gitk"
-#: gitk:3047
+#: gitk:3091
msgid "Gitk key bindings:"
msgstr "Tangentbordsbindningar för Gitk:"
-#: gitk:3049
+#: gitk:3093
#, tcl-format
msgid "<%s-Q>\t\tQuit"
msgstr "<%s-Q>\t\tAvsluta"
-#: gitk:3050
+#: gitk:3094
#, tcl-format
msgid "<%s-W>\t\tClose window"
msgstr "<%s-W>\t\tStäng fönster"
-#: gitk:3051
+#: gitk:3095
msgid "<Home>\t\tMove to first commit"
msgstr "<Home>\t\tGå till första incheckning"
-#: gitk:3052
+#: gitk:3096
msgid "<End>\t\tMove to last commit"
msgstr "<End>\t\tGå till sista incheckning"
-#: gitk:3053
+#: gitk:3097
msgid "<Up>, p, k\tMove up one commit"
msgstr "<Upp>, p, k\tGå en incheckning upp"
-#: gitk:3054
+#: gitk:3098
msgid "<Down>, n, j\tMove down one commit"
msgstr "<Ned>, n, j\tGå en incheckning ned"
-#: gitk:3055
+#: gitk:3099
msgid "<Left>, z, h\tGo back in history list"
msgstr "<Vänster>, z, h\tGå bakåt i historiken"
-#: gitk:3056
+#: gitk:3100
msgid "<Right>, x, l\tGo forward in history list"
msgstr "<Höger>, x, l\tGå framåt i historiken"
-#: gitk:3057
+#: gitk:3101
#, tcl-format
msgid "<%s-n>\tGo to n-th parent of current commit in history list"
msgstr "<%s-n>\tGå till aktuell inchecknings n:te förälder i historielistan"
-#: gitk:3058
+#: gitk:3102
msgid "<PageUp>\tMove up one page in commit list"
msgstr "<PageUp>\tGå upp en sida i incheckningslistan"
-#: gitk:3059
+#: gitk:3103
msgid "<PageDown>\tMove down one page in commit list"
msgstr "<PageDown>\tGå ned en sida i incheckningslistan"
-#: gitk:3060
+#: gitk:3104
#, tcl-format
msgid "<%s-Home>\tScroll to top of commit list"
msgstr "<%s-Home>\tRulla till början av incheckningslistan"
-#: gitk:3061
+#: gitk:3105
#, tcl-format
msgid "<%s-End>\tScroll to bottom of commit list"
msgstr "<%s-End>\tRulla till slutet av incheckningslistan"
-#: gitk:3062
+#: gitk:3106
#, tcl-format
msgid "<%s-Up>\tScroll commit list up one line"
msgstr "<%s-Upp>\tRulla incheckningslistan upp ett steg"
-#: gitk:3063
+#: gitk:3107
#, tcl-format
msgid "<%s-Down>\tScroll commit list down one line"
msgstr "<%s-Ned>\tRulla incheckningslistan ned ett steg"
-#: gitk:3064
+#: gitk:3108
#, tcl-format
msgid "<%s-PageUp>\tScroll commit list up one page"
msgstr "<%s-PageUp>\tRulla incheckningslistan upp en sida"
-#: gitk:3065
+#: gitk:3109
#, tcl-format
msgid "<%s-PageDown>\tScroll commit list down one page"
msgstr "<%s-PageDown>\tRulla incheckningslistan ned en sida"
-#: gitk:3066
+#: gitk:3110
msgid "<Shift-Up>\tFind backwards (upwards, later commits)"
msgstr "<Skift-Upp>\tSök bakåt (uppåt, senare incheckningar)"
-#: gitk:3067
+#: gitk:3111
msgid "<Shift-Down>\tFind forwards (downwards, earlier commits)"
msgstr "<Skift-Ned>\tSök framåt (nedåt, tidigare incheckningar)"
-#: gitk:3068
+#: gitk:3112
msgid "<Delete>, b\tScroll diff view up one page"
msgstr "<Delete>, b\tRulla diffvisningen upp en sida"
-#: gitk:3069
+#: gitk:3113
msgid "<Backspace>\tScroll diff view up one page"
msgstr "<Baksteg>\tRulla diffvisningen upp en sida"
-#: gitk:3070
+#: gitk:3114
msgid "<Space>\t\tScroll diff view down one page"
msgstr "<Blanksteg>\tRulla diffvisningen ned en sida"
-#: gitk:3071
+#: gitk:3115
msgid "u\t\tScroll diff view up 18 lines"
msgstr "u\t\tRulla diffvisningen upp 18 rader"
-#: gitk:3072
+#: gitk:3116
msgid "d\t\tScroll diff view down 18 lines"
msgstr "d\t\tRulla diffvisningen ned 18 rader"
-#: gitk:3073
+#: gitk:3117
#, tcl-format
msgid "<%s-F>\t\tFind"
msgstr "<%s-F>\t\tSök"
-#: gitk:3074
+#: gitk:3118
#, tcl-format
msgid "<%s-G>\t\tMove to next find hit"
msgstr "<%s-G>\t\tGå till nästa sökträff"
-#: gitk:3075
+#: gitk:3119
msgid "<Return>\tMove to next find hit"
msgstr "<Return>\t\tGå till nästa sökträff"
-#: gitk:3076
+#: gitk:3120
msgid "g\t\tGo to commit"
msgstr "g\t\tGå till incheckning"
-#: gitk:3077
+#: gitk:3121
msgid "/\t\tFocus the search box"
msgstr "/\t\tFokusera sökrutan"
-#: gitk:3078
+#: gitk:3122
msgid "?\t\tMove to previous find hit"
msgstr "?\t\tGå till föregående sökträff"
-#: gitk:3079
+#: gitk:3123
msgid "f\t\tScroll diff view to next file"
msgstr "f\t\tRulla diffvisningen till nästa fil"
-#: gitk:3080
+#: gitk:3124
#, tcl-format
msgid "<%s-S>\t\tSearch for next hit in diff view"
msgstr "<%s-S>\t\tGå till nästa sökträff i diffvisningen"
-#: gitk:3081
+#: gitk:3125
#, tcl-format
msgid "<%s-R>\t\tSearch for previous hit in diff view"
msgstr "<%s-R>\t\tGå till föregående sökträff i diffvisningen"
-#: gitk:3082
+#: gitk:3126
#, tcl-format
msgid "<%s-KP+>\tIncrease font size"
msgstr "<%s-Num+>\tÖka teckenstorlek"
-#: gitk:3083
+#: gitk:3127
#, tcl-format
msgid "<%s-plus>\tIncrease font size"
msgstr "<%s-plus>\tÖka teckenstorlek"
-#: gitk:3084
+#: gitk:3128
#, tcl-format
msgid "<%s-KP->\tDecrease font size"
msgstr "<%s-Num->\tMinska teckenstorlek"
-#: gitk:3085
+#: gitk:3129
#, tcl-format
msgid "<%s-minus>\tDecrease font size"
msgstr "<%s-minus>\tMinska teckenstorlek"
-#: gitk:3086
+#: gitk:3130
msgid "<F5>\t\tUpdate"
msgstr "<F5>\t\tUppdatera"
-#: gitk:3551 gitk:3560
+#: gitk:3597 gitk:3606
#, tcl-format
msgid "Error creating temporary directory %s:"
msgstr "Fel vid skapande av temporär katalog %s:"
-#: gitk:3573
+#: gitk:3619
#, tcl-format
msgid "Error getting \"%s\" from %s:"
-msgstr "Fel vid hämtning av \"%s\" från %s:"
+msgstr "Fel vid hämtning av ”%s” från %s:"
-#: gitk:3636
+#: gitk:3682
msgid "command failed:"
msgstr "kommando misslyckades:"
-#: gitk:3785
+#: gitk:3831
msgid "No such commit"
msgstr "Incheckning saknas"
-#: gitk:3799
+#: gitk:3845
msgid "git gui blame: command failed:"
msgstr "git gui blame: kommando misslyckades:"
-#: gitk:3830
+#: gitk:3876
#, tcl-format
msgid "Couldn't read merge head: %s"
msgstr "Kunde inte läsa sammanslagningshuvud: %s"
-#: gitk:3838
+#: gitk:3884
#, tcl-format
msgid "Error reading index: %s"
msgstr "Fel vid läsning av index: %s"
-#: gitk:3863
+#: gitk:3909
#, tcl-format
msgid "Couldn't start git blame: %s"
msgstr "Kunde inte starta git blame: %s"
-#: gitk:3866 gitk:6755
+#: gitk:3912 gitk:6801
msgid "Searching"
msgstr "Söker"
-#: gitk:3898
+#: gitk:3944
#, tcl-format
msgid "Error running git blame: %s"
msgstr "Fel vid körning av git blame: %s"
-#: gitk:3926
+#: gitk:3972
#, tcl-format
msgid "That line comes from commit %s, which is not in this view"
msgstr "Raden kommer från incheckningen %s, som inte finns i denna vy"
-#: gitk:3940
+#: gitk:3986
msgid "External diff viewer failed:"
msgstr "Externt diff-verktyg misslyckades:"
-#: gitk:4044
+#: gitk:4090
msgid "All files"
msgstr "Alla filer"
-#: gitk:4068
+#: gitk:4114
msgid "View"
msgstr "Visa"
-#: gitk:4071
+#: gitk:4117
msgid "Gitk view definition"
msgstr "Definition av Gitk-vy"
-#: gitk:4075
+#: gitk:4121
msgid "Remember this view"
msgstr "Spara denna vy"
-#: gitk:4076
+#: gitk:4122
msgid "References (space separated list):"
msgstr "Referenser (blankstegsavdelad lista):"
-#: gitk:4077
+#: gitk:4123
msgid "Branches & tags:"
msgstr "Grenar & taggar:"
-#: gitk:4078
+#: gitk:4124
msgid "All refs"
msgstr "Alla referenser"
-#: gitk:4079
+#: gitk:4125
msgid "All (local) branches"
msgstr "Alla (lokala) grenar"
-#: gitk:4080
+#: gitk:4126
msgid "All tags"
msgstr "Alla taggar"
-#: gitk:4081
+#: gitk:4127
msgid "All remote-tracking branches"
msgstr "Alla fjärrspårande grenar"
-#: gitk:4082
+#: gitk:4128
msgid "Commit Info (regular expressions):"
msgstr "Incheckningsinfo (reguljära uttryck):"
-#: gitk:4083
+#: gitk:4129
msgid "Author:"
msgstr "Författare:"
-#: gitk:4084
+#: gitk:4130
msgid "Committer:"
msgstr "Incheckare:"
-#: gitk:4085
+#: gitk:4131
msgid "Commit Message:"
msgstr "Incheckningsmeddelande:"
-#: gitk:4086
+#: gitk:4132
msgid "Matches all Commit Info criteria"
msgstr "Motsvarar alla kriterier för incheckningsinfo"
-#: gitk:4087
+#: gitk:4133
msgid "Matches no Commit Info criteria"
msgstr "Motsvarar inga kriterier för incheckningsinfo"
-#: gitk:4088
+#: gitk:4134
msgid "Changes to Files:"
msgstr "Ändringar av filer:"
-#: gitk:4089
+#: gitk:4135
msgid "Fixed String"
msgstr "Fast sträng"
-#: gitk:4090
+#: gitk:4136
msgid "Regular Expression"
msgstr "Reguljärt uttryck"
-#: gitk:4091
+#: gitk:4137
msgid "Search string:"
msgstr "Söksträng:"
-#: gitk:4092
+#: gitk:4138
msgid ""
"Commit Dates (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 "
"15:27:38\"):"
msgstr ""
-"Incheckingsdatum (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 "
-"15:27:38\"):"
+"Incheckningsdatum (”2 weeks ago”, ”2009-03-17 15:27:38”, ”March 17, 2009 "
+"15:27:38”):"
-#: gitk:4093
+#: gitk:4139
msgid "Since:"
msgstr "Från:"
-#: gitk:4094
+#: gitk:4140
msgid "Until:"
msgstr "Till:"
-#: gitk:4095
+#: gitk:4141
msgid "Limit and/or skip a number of revisions (positive integer):"
msgstr "Begränsa och/eller hoppa över ett antal revisioner (positivt heltal):"
-#: gitk:4096
+#: gitk:4142
msgid "Number to show:"
msgstr "Antal att visa:"
-#: gitk:4097
+#: gitk:4143
msgid "Number to skip:"
msgstr "Antal att hoppa över:"
-#: gitk:4098
+#: gitk:4144
msgid "Miscellaneous options:"
msgstr "Diverse alternativ:"
-#: gitk:4099
+#: gitk:4145
msgid "Strictly sort by date"
msgstr "Strikt datumsortering"
-#: gitk:4100
+#: gitk:4146
msgid "Mark branch sides"
msgstr "Markera sidogrenar"
-#: gitk:4101
+#: gitk:4147
msgid "Limit to first parent"
msgstr "Begränsa till första förälder"
-#: gitk:4102
+#: gitk:4148
msgid "Simple history"
msgstr "Enkel historik"
-#: gitk:4103
+#: gitk:4149
msgid "Additional arguments to git log:"
msgstr "Ytterligare argument till git log:"
-#: gitk:4104
+#: gitk:4150
msgid "Enter files and directories to include, one per line:"
msgstr "Ange filer och kataloger att ta med, en per rad:"
-#: gitk:4105
+#: gitk:4151
msgid "Command to generate more commits to include:"
msgstr "Kommando för att generera fler incheckningar att ta med:"
-#: gitk:4229
+#: gitk:4275
msgid "Gitk: edit view"
msgstr "Gitk: redigera vy"
-#: gitk:4237
+#: gitk:4283
msgid "-- criteria for selecting revisions"
msgstr " - kriterier för val av revisioner"
-#: gitk:4242
+#: gitk:4288
msgid "View Name"
msgstr "Namn på vy"
-#: gitk:4317
+#: gitk:4363
msgid "Apply (F5)"
msgstr "Använd (F5)"
-#: gitk:4355
+#: gitk:4401
msgid "Error in commit selection arguments:"
msgstr "Fel i argument för val av incheckningar:"
-#: gitk:4410 gitk:4463 gitk:4925 gitk:4939 gitk:6209 gitk:12388 gitk:12389
+#: gitk:4456 gitk:4509 gitk:4971 gitk:4985 gitk:6255 gitk:12615 gitk:12616
msgid "None"
msgstr "Inget"
-#: gitk:5022 gitk:5027
+#: gitk:5068 gitk:5073
msgid "Descendant"
msgstr "Avkomling"
-#: gitk:5023
+#: gitk:5069
msgid "Not descendant"
msgstr "Inte avkomling"
-#: gitk:5030 gitk:5035
+#: gitk:5076 gitk:5081
msgid "Ancestor"
msgstr "Förfader"
-#: gitk:5031
+#: gitk:5077
msgid "Not ancestor"
msgstr "Inte förfader"
-#: gitk:5325
+#: gitk:5371
msgid "Local changes checked in to index but not committed"
msgstr "Lokala ändringar sparade i indexet men inte incheckade"
-#: gitk:5361
+#: gitk:5407
msgid "Local uncommitted changes, not checked in to index"
msgstr "Lokala ändringar, ej sparade i indexet"
-#: gitk:7135
+#: gitk:7155
+msgid "Error starting web browser:"
+msgstr "Fel när webbläsaren skulle startas:"
+
+#: gitk:7216
msgid "and many more"
msgstr "med många flera"
-#: gitk:7138
+#: gitk:7219
msgid "many"
msgstr "många"
-#: gitk:7329
+#: gitk:7410
msgid "Tags:"
msgstr "Taggar:"
-#: gitk:7346 gitk:7352 gitk:8826
+#: gitk:7427 gitk:7433 gitk:8912
msgid "Parent"
msgstr "Förälder"
-#: gitk:7357
+#: gitk:7438
msgid "Child"
msgstr "Barn"
-#: gitk:7366
+#: gitk:7447
msgid "Branch"
msgstr "Gren"
-#: gitk:7369
+#: gitk:7450
msgid "Follows"
msgstr "Följer"
-#: gitk:7372
+#: gitk:7453
msgid "Precedes"
msgstr "Föregår"
-#: gitk:7967
+#: gitk:8048
#, tcl-format
msgid "Error getting diffs: %s"
msgstr "Fel vid hämtning av diff: %s"
-#: gitk:8651
+#: gitk:8737
msgid "Goto:"
msgstr "Gå till:"
-#: gitk:8672
+#: gitk:8758
#, tcl-format
msgid "Short SHA1 id %s is ambiguous"
msgstr "Förkortat SHA1-id %s är tvetydigt"
-#: gitk:8679
+#: gitk:8765
#, tcl-format
msgid "Revision %s is not known"
msgstr "Revisionen %s är inte känd"
-#: gitk:8689
+#: gitk:8775
#, tcl-format
msgid "SHA1 id %s is not known"
msgstr "SHA-id:t %s är inte känt"
-#: gitk:8691
+#: gitk:8777
#, tcl-format
msgid "Revision %s is not in the current view"
msgstr "Revisionen %s finns inte i den nuvarande vyn"
-#: gitk:8833 gitk:8848
+#: gitk:8919 gitk:8934
msgid "Date"
msgstr "Datum"
-#: gitk:8836
+#: gitk:8922
msgid "Children"
msgstr "Barn"
-#: gitk:8899
+#: gitk:8985
#, tcl-format
msgid "Reset %s branch to here"
msgstr "Återställ grenen %s hit"
-#: gitk:8901
+#: gitk:8987
msgid "Detached head: can't reset"
msgstr "Frånkopplad head: kan inte återställa"
-#: gitk:9006 gitk:9012
+#: gitk:9092 gitk:9098
msgid "Skipping merge commit "
msgstr "Hoppar över sammanslagningsincheckning "
-#: gitk:9021 gitk:9026
+#: gitk:9107 gitk:9112
msgid "Error getting patch ID for "
msgstr "Fel vid hämtning av patch-id för "
-#: gitk:9022 gitk:9027
+#: gitk:9108 gitk:9113
msgid " - stopping\n"
msgstr " - stannar\n"
-#: gitk:9032 gitk:9035 gitk:9043 gitk:9057 gitk:9066
+#: gitk:9118 gitk:9121 gitk:9129 gitk:9143 gitk:9152
msgid "Commit "
msgstr "Incheckning "
-#: gitk:9036
+#: gitk:9122
msgid ""
" is the same patch as\n"
" "
@@ -911,7 +919,7 @@ msgstr ""
" är samma patch som\n"
" "
-#: gitk:9044
+#: gitk:9130
msgid ""
" differs from\n"
" "
@@ -919,7 +927,7 @@ msgstr ""
" skiljer sig från\n"
" "
-#: gitk:9046
+#: gitk:9132
msgid ""
"Diff of commits:\n"
"\n"
@@ -927,141 +935,158 @@ msgstr ""
"Skillnad mellan incheckningar:\n"
"\n"
-#: gitk:9058 gitk:9067
+#: gitk:9144 gitk:9153
#, tcl-format
msgid " has %s children - stopping\n"
msgstr " har %s barn - stannar\n"
-#: gitk:9086
+#: gitk:9172
#, tcl-format
msgid "Error writing commit to file: %s"
msgstr "Fel vid skrivning av incheckning till fil: %s"
-#: gitk:9092
+#: gitk:9178
#, tcl-format
msgid "Error diffing commits: %s"
msgstr "Fel vid jämförelse av incheckningar: %s"
-#: gitk:9138
+#: gitk:9224
msgid "Top"
msgstr "Topp"
-#: gitk:9139
+#: gitk:9225
msgid "From"
msgstr "Från"
-#: gitk:9144
+#: gitk:9230
msgid "To"
msgstr "Till"
-#: gitk:9168
+#: gitk:9254
msgid "Generate patch"
msgstr "Generera patch"
-#: gitk:9170
+#: gitk:9256
msgid "From:"
msgstr "Från:"
-#: gitk:9179
+#: gitk:9265
msgid "To:"
msgstr "Till:"
-#: gitk:9188
+#: gitk:9274
msgid "Reverse"
msgstr "Vänd"
-#: gitk:9190 gitk:9400
+#: gitk:9276 gitk:9486
msgid "Output file:"
msgstr "Utdatafil:"
-#: gitk:9196
+#: gitk:9282
msgid "Generate"
msgstr "Generera"
-#: gitk:9234
+#: gitk:9320
msgid "Error creating patch:"
msgstr "Fel vid generering av patch:"
-#: gitk:9257 gitk:9388 gitk:9445
+#: gitk:9343 gitk:9474 gitk:9562
msgid "ID:"
msgstr "Id:"
-#: gitk:9266
+#: gitk:9352
msgid "Tag name:"
msgstr "Taggnamn:"
-#: gitk:9269
+#: gitk:9355
msgid "Tag message is optional"
msgstr "Taggmeddelandet är valfritt"
-#: gitk:9271
+#: gitk:9357
msgid "Tag message:"
msgstr "Taggmeddelande:"
-#: gitk:9275 gitk:9454
+#: gitk:9361 gitk:9532
msgid "Create"
msgstr "Skapa"
-#: gitk:9293
+#: gitk:9379
msgid "No tag name specified"
msgstr "Inget taggnamn angavs"
-#: gitk:9297
+#: gitk:9383
#, tcl-format
msgid "Tag \"%s\" already exists"
-msgstr "Taggen \"%s\" finns redan"
+msgstr "Taggen ”%s” finns redan"
-#: gitk:9307
+#: gitk:9393
msgid "Error creating tag:"
msgstr "Fel vid skapande av tagg:"
-#: gitk:9397
+#: gitk:9483
msgid "Command:"
msgstr "Kommando:"
-#: gitk:9405
+#: gitk:9491
msgid "Write"
msgstr "Skriv"
-#: gitk:9423
+#: gitk:9509
msgid "Error writing commit:"
msgstr "Fel vid skrivning av incheckning:"
-#: gitk:9450
+#: gitk:9531
+msgid "Create branch"
+msgstr "Skapa gren"
+
+#: gitk:9547
+#, tcl-format
+msgid "Rename branch %s"
+msgstr "Byt namn på grenen %s"
+
+#: gitk:9548
+msgid "Rename"
+msgstr "Byt namn"
+
+#: gitk:9572
msgid "Name:"
msgstr "Namn:"
-#: gitk:9473
+#: gitk:9596
msgid "Please specify a name for the new branch"
msgstr "Ange ett namn för den nya grenen"
-#: gitk:9478
+#: gitk:9601
#, tcl-format
msgid "Branch '%s' already exists. Overwrite?"
-msgstr "Grenen \"%s\" finns redan. Skriva över?"
+msgstr "Grenen ”%s” finns redan. Skriva över?"
+
+#: gitk:9645
+msgid "Please specify a new name for the branch"
+msgstr "Ange ett nytt namn för grenen"
-#: gitk:9545
+#: gitk:9708
#, tcl-format
msgid "Commit %s is already included in branch %s -- really re-apply it?"
msgstr ""
"Incheckningen %s finns redan på grenen %s -- skall den verkligen appliceras "
"på nytt?"
-#: gitk:9550
+#: gitk:9713
msgid "Cherry-picking"
msgstr "Plockar"
-#: gitk:9559
+#: gitk:9722
#, tcl-format
msgid ""
"Cherry-pick failed because of local changes to file '%s'.\n"
"Please commit, reset or stash your changes and try again."
msgstr ""
-"Cherry-pick misslyckades på grund av lokala ändringar i filen \"%s\".\n"
+"Cherry-pick misslyckades på grund av lokala ändringar i filen ”%s”.\n"
"Checka in, återställ eller spara undan (stash) dina ändringar och försök "
"igen."
-#: gitk:9565
+#: gitk:9728
msgid ""
"Cherry-pick failed because of merge conflict.\n"
"Do you wish to run git citool to resolve it?"
@@ -1069,20 +1094,20 @@ msgstr ""
"Cherry-pick misslyckades på grund av en sammanslagningskonflikt.\n"
"Vill du köra git citool för att lösa den?"
-#: gitk:9581 gitk:9639
+#: gitk:9744 gitk:9802
msgid "No changes committed"
msgstr "Inga ändringar incheckade"
-#: gitk:9608
+#: gitk:9771
#, tcl-format
msgid "Commit %s is not included in branch %s -- really revert it?"
msgstr "Incheckningen %s finns inte på grenen %s -- vill du verkligen ångra?"
-#: gitk:9613
+#: gitk:9776
msgid "Reverting"
msgstr "Ångrar"
-#: gitk:9621
+#: gitk:9784
#, tcl-format
msgid ""
"Revert failed because of local changes to the following files:%s Please "
@@ -1092,7 +1117,7 @@ msgstr ""
"Checka in, återställ eller spara undan (stash) dina ändringar och försök "
"igen."
-#: gitk:9625
+#: gitk:9788
msgid ""
"Revert failed because of merge conflict.\n"
" Do you wish to run git citool to resolve it?"
@@ -1100,28 +1125,28 @@ msgstr ""
"Misslyckades med att ångra på grund av en sammanslagningskonflikt.\n"
" Vill du köra git citool för att lösa den?"
-#: gitk:9668
+#: gitk:9831
msgid "Confirm reset"
msgstr "Bekräfta återställning"
-#: gitk:9670
+#: gitk:9833
#, tcl-format
msgid "Reset branch %s to %s?"
msgstr "Återställa grenen %s till %s?"
-#: gitk:9672
+#: gitk:9835
msgid "Reset type:"
msgstr "Typ av återställning:"
-#: gitk:9675
+#: gitk:9838
msgid "Soft: Leave working tree and index untouched"
msgstr "Mjuk: Rör inte utcheckning och index"
-#: gitk:9678
+#: gitk:9841
msgid "Mixed: Leave working tree untouched, reset index"
msgstr "Blandad: Rör inte utcheckning, återställ index"
-#: gitk:9681
+#: gitk:9844
msgid ""
"Hard: Reset working tree and index\n"
"(discard ALL local changes)"
@@ -1129,19 +1154,24 @@ msgstr ""
"Hård: Återställ utcheckning och index\n"
"(förkastar ALLA lokala ändringar)"
-#: gitk:9698
+#: gitk:9861
msgid "Resetting"
msgstr "Återställer"
-#: gitk:9758
+#: gitk:9934
+#, tcl-format
+msgid "A local branch named %s exists already"
+msgstr "Det finns redan en lokal gren som heter %s"
+
+#: gitk:9942
msgid "Checking out"
msgstr "Checkar ut"
-#: gitk:9811
+#: gitk:10001
msgid "Cannot delete the currently checked-out branch"
msgstr "Kan inte ta bort den just nu utcheckade grenen"
-#: gitk:9817
+#: gitk:10007
#, tcl-format
msgid ""
"The commits on branch %s aren't on any other branch.\n"
@@ -1150,16 +1180,16 @@ msgstr ""
"Incheckningarna på grenen %s existerar inte på någon annan gren.\n"
"Vill du verkligen ta bort grenen %s?"
-#: gitk:9848
+#: gitk:10038
#, tcl-format
msgid "Tags and heads: %s"
msgstr "Taggar och huvuden: %s"
-#: gitk:9865
+#: gitk:10055
msgid "Filter"
msgstr "Filter"
-#: gitk:10161
+#: gitk:10356
msgid ""
"Error reading commit topology information; branch and preceding/following "
"tag information will be incomplete."
@@ -1167,201 +1197,221 @@ msgstr ""
"Fel vid läsning av information om incheckningstopologi; information om "
"grenar och föregående/senare taggar kommer inte vara komplett."
-#: gitk:11138
+#: gitk:11333
msgid "Tag"
msgstr "Tagg"
-#: gitk:11142
+#: gitk:11337
msgid "Id"
msgstr "Id"
-#: gitk:11225
+#: gitk:11420
msgid "Gitk font chooser"
msgstr "Teckensnittsväljare för Gitk"
-#: gitk:11242
+#: gitk:11437
msgid "B"
msgstr "F"
-#: gitk:11245
+#: gitk:11440
msgid "I"
msgstr "K"
-#: gitk:11363
+#: gitk:11558
msgid "Commit list display options"
msgstr "Alternativ för incheckningslistvy"
-#: gitk:11366
+#: gitk:11561
msgid "Maximum graph width (lines)"
msgstr "Maximal grafbredd (rader)"
-#: gitk:11370
+#: gitk:11565
#, no-tcl-format
msgid "Maximum graph width (% of pane)"
msgstr "Maximal grafbredd (% av ruta)"
-#: gitk:11373
+#: gitk:11568
msgid "Show local changes"
msgstr "Visa lokala ändringar"
-#: gitk:11376
+#: gitk:11571
msgid "Auto-select SHA1 (length)"
msgstr "Välj SHA1 (längd) automatiskt"
-#: gitk:11380
+#: gitk:11575
msgid "Hide remote refs"
msgstr "Dölj fjärr-referenser"
-#: gitk:11384
+#: gitk:11579
msgid "Diff display options"
msgstr "Alternativ för diffvy"
-#: gitk:11386
+#: gitk:11581
msgid "Tab spacing"
msgstr "Blanksteg för tabulatortecken"
-#: gitk:11389
+#: gitk:11584
msgid "Display nearby tags/heads"
msgstr "Visa närliggande taggar/huvuden"
-#: gitk:11392
+#: gitk:11587
msgid "Maximum # tags/heads to show"
msgstr "Maximalt antal taggar/huvuden att visa"
-#: gitk:11395
+#: gitk:11590
msgid "Limit diffs to listed paths"
msgstr "Begränsa diff till listade sökvägar"
-#: gitk:11398
+#: gitk:11593
msgid "Support per-file encodings"
msgstr "Stöd för filspecifika teckenkodningar"
-#: gitk:11404 gitk:11551
+#: gitk:11599 gitk:11766
msgid "External diff tool"
msgstr "Externt diff-verktyg"
-#: gitk:11405
+#: gitk:11600
msgid "Choose..."
msgstr "Välj..."
-#: gitk:11410
+#: gitk:11607
+msgid "Web browser"
+msgstr "Webbläsare"
+
+#: gitk:11612
msgid "General options"
msgstr "Allmänna inställningar"
-#: gitk:11413
+#: gitk:11615
msgid "Use themed widgets"
msgstr "Använd tema på fönsterelement"
-#: gitk:11415
+#: gitk:11617
msgid "(change requires restart)"
msgstr "(ändringen kräver omstart)"
-#: gitk:11417
+#: gitk:11619
msgid "(currently unavailable)"
msgstr "(för närvarande inte tillgängligt)"
-#: gitk:11428
+#: gitk:11631
msgid "Colors: press to choose"
msgstr "Färger: tryck för att välja"
-#: gitk:11431
+#: gitk:11634
msgid "Interface"
msgstr "Gränssnitt"
-#: gitk:11432
+#: gitk:11635
msgid "interface"
msgstr "gränssnitt"
-#: gitk:11435
+#: gitk:11638
msgid "Background"
msgstr "Bakgrund"
-#: gitk:11436 gitk:11466
+#: gitk:11639 gitk:11681
msgid "background"
msgstr "bakgrund"
-#: gitk:11439
+#: gitk:11642
msgid "Foreground"
msgstr "Förgrund"
-#: gitk:11440
+#: gitk:11643
msgid "foreground"
msgstr "förgrund"
-#: gitk:11443
+#: gitk:11646
msgid "Diff: old lines"
msgstr "Diff: gamla rader"
-#: gitk:11444
+#: gitk:11647
msgid "diff old lines"
msgstr "diff gamla rader"
-#: gitk:11448
+#: gitk:11651
+msgid "Diff: old lines bg"
+msgstr "Diff: gamla rader bg"
+
+#: gitk:11653
+msgid "diff old lines bg"
+msgstr "diff gamla rader bg"
+
+#: gitk:11657
msgid "Diff: new lines"
msgstr "Diff: nya rader"
-#: gitk:11449
+#: gitk:11658
msgid "diff new lines"
msgstr "diff nya rader"
-#: gitk:11453
+#: gitk:11662
+msgid "Diff: new lines bg"
+msgstr "Diff: nya rader bg"
+
+#: gitk:11664
+msgid "diff new lines bg"
+msgstr "diff nya rader bg"
+
+#: gitk:11668
msgid "Diff: hunk header"
msgstr "Diff: delhuvud"
-#: gitk:11455
+#: gitk:11670
msgid "diff hunk header"
msgstr "diff delhuvud"
-#: gitk:11459
+#: gitk:11674
msgid "Marked line bg"
msgstr "Markerad rad bakgrund"
-#: gitk:11461
+#: gitk:11676
msgid "marked line background"
msgstr "markerad rad bakgrund"
-#: gitk:11465
+#: gitk:11680
msgid "Select bg"
msgstr "Markerad bakgrund"
-#: gitk:11474
+#: gitk:11689
msgid "Fonts: press to choose"
msgstr "Teckensnitt: tryck för att välja"
-#: gitk:11476
+#: gitk:11691
msgid "Main font"
msgstr "Huvudteckensnitt"
-#: gitk:11477
+#: gitk:11692
msgid "Diff display font"
msgstr "Teckensnitt för diffvisning"
-#: gitk:11478
+#: gitk:11693
msgid "User interface font"
msgstr "Teckensnitt för användargränssnitt"
-#: gitk:11500
+#: gitk:11715
msgid "Gitk preferences"
msgstr "Inställningar för Gitk"
-#: gitk:11509
+#: gitk:11724
msgid "General"
msgstr "Allmänt"
-#: gitk:11510
+#: gitk:11725
msgid "Colors"
msgstr "Färger"
-#: gitk:11511
+#: gitk:11726
msgid "Fonts"
msgstr "Teckensnitt"
-#: gitk:11561
+#: gitk:11776
#, tcl-format
msgid "Gitk: choose color for %s"
msgstr "Gitk: välj färg för %s"
-#: gitk:12074
+#: gitk:12289
msgid ""
"Sorry, gitk cannot run with this version of Tcl/Tk.\n"
" Gitk requires at least Tcl/Tk 8.4."
@@ -1369,45 +1419,15 @@ msgstr ""
"Gitk kan tyvärr inte köra med denna version av Tcl/Tk.\n"
" Gitk kräver åtminstone Tcl/Tk 8.4."
-#: gitk:12284
+#: gitk:12507
msgid "Cannot find a git repository here."
msgstr "Hittar inget git-arkiv här."
-#: gitk:12331
+#: gitk:12554
#, tcl-format
msgid "Ambiguous argument '%s': both revision and filename"
-msgstr "Tvetydigt argument \"%s\": både revision och filnamn"
+msgstr "Tvetydigt argument ”%s”: både revision och filnamn"
-#: gitk:12343
+#: gitk:12566
msgid "Bad arguments to gitk:"
msgstr "Felaktiga argument till gitk:"
-
-#~ msgid "mc"
-#~ msgstr "mc"
-
-#~ msgid "next"
-#~ msgstr "nästa"
-
-#~ msgid "prev"
-#~ msgstr "föreg"
-
-#~ msgid "CDate"
-#~ msgstr "Skapat datum"
-
-#~ msgid "Cannot find the git directory \"%s\"."
-#~ msgstr "Hittar inte git-katalogen \"%s\"."
-
-#~ msgid "SHA1 ID: "
-#~ msgstr "SHA1-id: "
-
-#~ msgid "- stopping\n"
-#~ msgstr "- stannar\n"
-
-#~ msgid "Tag/Head %s is not known"
-#~ msgstr "Tagg/huvud %s är okänt"
-
-#~ msgid "/\t\tMove to next find hit, or redo find"
-#~ msgstr "/\t\tGå till nästa sökträff, eller sök på nytt"
-
-#~ msgid "Name"
-#~ msgstr "Namn"
diff --git a/gitweb/GITWEB-BUILD-OPTIONS.in b/gitweb/GITWEB-BUILD-OPTIONS.in
new file mode 100644
index 0000000000..41ac20654c
--- /dev/null
+++ b/gitweb/GITWEB-BUILD-OPTIONS.in
@@ -0,0 +1,24 @@
+PERL_PATH=@PERL_PATH@
+JSMIN=@JSMIN@
+CSSMIN=@CSSMIN@
+GIT_BINDIR=@GIT_BINDIR@
+GITWEB_CONFIG=@GITWEB_CONFIG@
+GITWEB_CONFIG_SYSTEM=@GITWEB_CONFIG_SYSTEM@
+GITWEB_CONFIG_COMMON=@GITWEB_CONFIG_COMMON@
+GITWEB_HOME_LINK_STR=@GITWEB_HOME_LINK_STR@
+GITWEB_SITENAME=@GITWEB_SITENAME@
+GITWEB_PROJECTROOT=@GITWEB_PROJECTROOT@
+GITWEB_PROJECT_MAXDEPTH=@GITWEB_PROJECT_MAXDEPTH@
+GITWEB_EXPORT_OK=@GITWEB_EXPORT_OK@
+GITWEB_STRICT_EXPORT=@GITWEB_STRICT_EXPORT@
+GITWEB_BASE_URL=@GITWEB_BASE_URL@
+GITWEB_LIST=@GITWEB_LIST@
+GITWEB_HOMETEXT=@GITWEB_HOMETEXT@
+GITWEB_CSS=@GITWEB_CSS@
+GITWEB_LOGO=@GITWEB_LOGO@
+GITWEB_FAVICON=@GITWEB_FAVICON@
+GITWEB_JS=@GITWEB_JS@
+GITWEB_SITE_HTML_HEAD_STRING=@GITWEB_SITE_HTML_HEAD_STRING@
+GITWEB_SITE_HEADER=@GITWEB_SITE_HEADER@
+GITWEB_SITE_FOOTER=@GITWEB_SITE_FOOTER@
+HIGHLIGHT_BIN=@HIGHLIGHT_BIN@
diff --git a/gitweb/Makefile b/gitweb/Makefile
index 3b68ab2d67..d5748e9359 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -77,48 +77,48 @@ GITWEB_JSLIB_FILES += static/js/javascript-detection.js
GITWEB_JSLIB_FILES += static/js/adjust-timezone.js
GITWEB_JSLIB_FILES += static/js/blame_incremental.js
-
-GITWEB_REPLACE = \
- -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
- -e 's|++GIT_BINDIR++|$(bindir)|g' \
- -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
- -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
- -e 's|++GITWEB_CONFIG_COMMON++|$(GITWEB_CONFIG_COMMON)|g' \
- -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
- -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
- -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
- -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
- -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
- -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
- -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
- -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
- -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
- -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
- -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
- -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
- -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
- -e 's|++GITWEB_SITE_HTML_HEAD_STRING++|$(GITWEB_SITE_HTML_HEAD_STRING)|g' \
- -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
- -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
- -e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g'
-
.PHONY: FORCE
$(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS: FORCE
- @rm -f $@+
- @echo "x" '$(PERL_PATH_SQ)' $(GITWEB_REPLACE) "$(JSMIN)|$(CSSMIN)" >$@+
+ @sed -e 's|@PERL_PATH@|$(PERL_PATH_SQ)|' \
+ -e 's|@JSMIN@|$(JSMIN)|' \
+ -e 's|@CSSMIN@|$(CSSMIN)|' \
+ -e 's|@GIT_VERSION@|$(GIT_VERSION)|' \
+ -e 's|@GIT_BINDIR@|$(bindir)|' \
+ -e 's|@GITWEB_CONFIG@|$(GITWEB_CONFIG)|' \
+ -e 's|@GITWEB_CONFIG_SYSTEM@|$(GITWEB_CONFIG_SYSTEM)|' \
+ -e 's|@GITWEB_CONFIG_COMMON@|$(GITWEB_CONFIG_COMMON)|' \
+ -e 's|@GITWEB_HOME_LINK_STR@|$(GITWEB_HOME_LINK_STR)|' \
+ -e 's|@GITWEB_SITENAME@|$(GITWEB_SITENAME)|' \
+ -e 's|@GITWEB_PROJECTROOT@|$(GITWEB_PROJECTROOT)|' \
+ -e 's|@GITWEB_PROJECT_MAXDEPTH@|$(GITWEB_PROJECT_MAXDEPTH)|' \
+ -e 's|@GITWEB_EXPORT_OK@|$(GITWEB_EXPORT_OK)|' \
+ -e 's|@GITWEB_STRICT_EXPORT@|$(GITWEB_STRICT_EXPORT)|' \
+ -e 's|@GITWEB_BASE_URL@|$(GITWEB_BASE_URL)|' \
+ -e 's|@GITWEB_LIST@|$(GITWEB_LIST)|' \
+ -e 's|@GITWEB_HOMETEXT@|$(GITWEB_HOMETEXT)|' \
+ -e 's|@GITWEB_CSS@|$(GITWEB_CSS)|' \
+ -e 's|@GITWEB_LOGO@|$(GITWEB_LOGO)|' \
+ -e 's|@GITWEB_FAVICON@|$(GITWEB_FAVICON)|' \
+ -e 's|@GITWEB_JS@|$(GITWEB_JS)|' \
+ -e 's|@GITWEB_SITE_HTML_HEAD_STRING@|$(GITWEB_SITE_HTML_HEAD_STRING)|' \
+ -e 's|@GITWEB_SITE_HEADER@|$(GITWEB_SITE_HEADER)|' \
+ -e 's|@GITWEB_SITE_FOOTER@|$(GITWEB_SITE_FOOTER)|' \
+ -e 's|@HIGHLIGHT_BIN@|$(HIGHLIGHT_BIN)|' \
+ $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS.in >"$@+"
@cmp -s $@+ $@ && rm -f $@+ || mv -f $@+ $@
+$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)generate-gitweb-cgi.sh
$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
+$(MAK_DIR_GITWEB)gitweb.cgi: GIT-VERSION-FILE
$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl
$(QUIET_GEN)$(RM) $@ $@+ && \
- sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
- $(GITWEB_REPLACE) $< >$@+ && \
- chmod +x $@+ && \
+ $(MAK_DIR_GITWEB)generate-gitweb-cgi.sh $(MAK_DIR_GITWEB)/GITWEB-BUILD-OPTIONS ./GIT-VERSION-FILE $< $@+ && \
mv $@+ $@
+$(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh
$(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))
$(QUIET_GEN)$(RM) $@ $@+ && \
- cat $^ >$@+ && \
+ $(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \
mv $@+ $@
### Installation rules
diff --git a/gitweb/generate-gitweb-cgi.sh b/gitweb/generate-gitweb-cgi.sh
new file mode 100755
index 0000000000..ede9038c33
--- /dev/null
+++ b/gitweb/generate-gitweb-cgi.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 4
+then
+ echo >&2 "USAGE: $0 <GITWEB-BUILD-OPTIONS> <GIT-VERSION-FILE> <INPUT> <OUTPUT>"
+ exit 1
+fi
+
+GITWEB_BUILD_OPTIONS="$1"
+GIT_VERSION_FILE="$2"
+INPUT="$3"
+OUTPUT="$4"
+
+. "$GITWEB_BUILD_OPTIONS"
+. "$GIT_VERSION_FILE"
+
+sed -e "1s|#!/usr/bin/perl|#!$PERL_PATH|" \
+ -e "s|@PERL_PATH@|$PERL_PATH|" \
+ -e "s|@JSMIN@|$JSMIN|" \
+ -e "s|@CSSMIN@|$CSSMIN|" \
+ -e "s|@GIT_VERSION@|$GIT_VERSION|" \
+ -e "s|@GIT_BINDIR@|$GIT_BINDIR|" \
+ -e "s|@GITWEB_CONFIG@|$GITWEB_CONFIG|" \
+ -e "s|@GITWEB_CONFIG_SYSTEM@|$GITWEB_CONFIG_SYSTEM|" \
+ -e "s|@GITWEB_CONFIG_COMMON@|$GITWEB_CONFIG_COMMON|" \
+ -e "s|@GITWEB_HOME_LINK_STR@|$GITWEB_HOME_LINK_STR|" \
+ -e "s|@GITWEB_SITENAME@|$GITWEB_SITENAME|" \
+ -e "s|@GITWEB_PROJECTROOT@|$GITWEB_PROJECTROOT|" \
+ -e "s|@GITWEB_PROJECT_MAXDEPTH@|$GITWEB_PROJECT_MAXDEPTH|" \
+ -e "s|@GITWEB_EXPORT_OK@|$GITWEB_EXPORT_OK|" \
+ -e "s|@GITWEB_STRICT_EXPORT@|$GITWEB_STRICT_EXPORT|" \
+ -e "s|@GITWEB_BASE_URL@|$GITWEB_BASE_URL|" \
+ -e "s|@GITWEB_LIST@|$GITWEB_LIST|" \
+ -e "s|@GITWEB_HOMETEXT@|$GITWEB_HOMETEXT|" \
+ -e "s|@GITWEB_CSS@|$GITWEB_CSS|" \
+ -e "s|@GITWEB_LOGO@|$GITWEB_LOGO|" \
+ -e "s|@GITWEB_FAVICON@|$GITWEB_FAVICON|" \
+ -e "s|@GITWEB_JS@|$GITWEB_JS|" \
+ -e "s|@GITWEB_SITE_HTML_HEAD_STRING@|$GITWEB_SITE_HTML_HEAD_STRING|" \
+ -e "s|@GITWEB_SITE_HEADER@|$GITWEB_SITE_HEADER|" \
+ -e "s|@GITWEB_SITE_FOOTER@|$GITWEB_SITE_FOOTER|" \
+ -e "s|@HIGHLIGHT_BIN@|$HIGHLIGHT_BIN|" \
+ "$INPUT" >"$OUTPUT"
+
+chmod a+x "$OUTPUT"
diff --git a/gitweb/generate-gitweb-js.sh b/gitweb/generate-gitweb-js.sh
new file mode 100755
index 0000000000..01bb22b04b
--- /dev/null
+++ b/gitweb/generate-gitweb-js.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if test "$#" -lt 2
+then
+ echo >&2 "USAGE: $0 <OUTPUT> <INPUT>..."
+ exit 1
+fi
+
+OUTPUT="$1"
+shift
+
+cat "$@" >"$OUTPUT"
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c4e0008d59..b5490dfecf 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -35,7 +35,7 @@ BEGIN {
CGI->compile() if $ENV{'MOD_PERL'};
}
-our $version = "++GIT_VERSION++";
+our $version = "@GIT_VERSION@";
our ($my_url, $my_uri, $base_url, $path_info, $home_link);
sub evaluate_uri {
@@ -80,46 +80,46 @@ sub evaluate_uri {
# core git executable to use
# this can just be "git" if your webserver has a sensible PATH
-our $GIT = "++GIT_BINDIR++/git";
+our $GIT = "@GIT_BINDIR@/git";
# absolute fs-path which will be prepended to the project path
#our $projectroot = "/pub/scm";
-our $projectroot = "++GITWEB_PROJECTROOT++";
+our $projectroot = "@GITWEB_PROJECTROOT@";
# fs traversing limit for getting project list
# the number is relative to the projectroot
-our $project_maxdepth = "++GITWEB_PROJECT_MAXDEPTH++";
+our $project_maxdepth = @GITWEB_PROJECT_MAXDEPTH@;
# string of the home link on top of all pages
-our $home_link_str = "++GITWEB_HOME_LINK_STR++";
+our $home_link_str = "@GITWEB_HOME_LINK_STR@";
# extra breadcrumbs preceding the home link
our @extra_breadcrumbs = ();
# name of your site or organization to appear in page titles
# replace this with something more descriptive for clearer bookmarks
-our $site_name = "++GITWEB_SITENAME++"
+our $site_name = "@GITWEB_SITENAME@"
|| ($ENV{'SERVER_NAME'} || "Untitled") . " Git";
# html snippet to include in the <head> section of each page
-our $site_html_head_string = "++GITWEB_SITE_HTML_HEAD_STRING++";
+our $site_html_head_string = "@GITWEB_SITE_HTML_HEAD_STRING@";
# filename of html text to include at top of each page
-our $site_header = "++GITWEB_SITE_HEADER++";
+our $site_header = "@GITWEB_SITE_HEADER@";
# html text to include at home page
-our $home_text = "++GITWEB_HOMETEXT++";
+our $home_text = "@GITWEB_HOMETEXT@";
# filename of html text to include at bottom of each page
-our $site_footer = "++GITWEB_SITE_FOOTER++";
+our $site_footer = "@GITWEB_SITE_FOOTER@";
# URI of stylesheets
-our @stylesheets = ("++GITWEB_CSS++");
+our @stylesheets = ("@GITWEB_CSS@");
# URI of a single stylesheet, which can be overridden in GITWEB_CONFIG.
our $stylesheet = undef;
# URI of GIT logo (72x27 size)
-our $logo = "++GITWEB_LOGO++";
+our $logo = "@GITWEB_LOGO@";
# URI of GIT favicon, assumed to be image/png type
-our $favicon = "++GITWEB_FAVICON++";
+our $favicon = "@GITWEB_FAVICON@";
# URI of gitweb.js (JavaScript code for gitweb)
-our $javascript = "++GITWEB_JS++";
+our $javascript = "@GITWEB_JS@";
# URI and label (title) of GIT logo link
#our $logo_url = "https://www.kernel.org/pub/software/scm/git/docs/";
@@ -128,7 +128,7 @@ our $logo_url = "https://git-scm.com/";
our $logo_label = "git homepage";
# source of projects list
-our $projects_list = "++GITWEB_LIST++";
+our $projects_list = "@GITWEB_LIST@";
# the width (in characters) of the projects list "Description" column
our $projects_list_description_width = 25;
@@ -147,7 +147,7 @@ our $default_projects_order = "project";
# show repository only if this file exists
# (only effective if this variable evaluates to true)
-our $export_ok = "++GITWEB_EXPORT_OK++";
+our $export_ok = "@GITWEB_EXPORT_OK@";
# don't generate age column on the projects list page
our $omit_age_column = 0;
@@ -161,11 +161,11 @@ our $omit_owner=0;
our $export_auth_hook = undef;
# only allow viewing of repositories also shown on the overview page
-our $strict_export = "++GITWEB_STRICT_EXPORT++";
+our $strict_export = "@GITWEB_STRICT_EXPORT@";
# list of git base URLs used for URL to where fetch project from,
# i.e. full URL is "$git_base_url/$project"
-our @git_base_url_list = grep { $_ ne '' } ("++GITWEB_BASE_URL++");
+our @git_base_url_list = grep { $_ ne '' } ("@GITWEB_BASE_URL@");
# default blob_plain mimetype and default charset for text/plain blob
our $default_blob_plain_mimetype = 'text/plain';
@@ -200,7 +200,7 @@ our $prevent_xss = 0;
# http://andre-simon.de/zip/download.php due to assumptions about parameters and output).
# Useful if highlight is not installed on your webserver's PATH.
# [Default: highlight]
-our $highlight_bin = "++HIGHLIGHT_BIN++";
+our $highlight_bin = "@HIGHLIGHT_BIN@";
# information about snapshot formats that gitweb is capable of serving
our %known_snapshot_formats = (
@@ -741,9 +741,9 @@ sub read_config_file {
our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM, $GITWEB_CONFIG_COMMON);
sub evaluate_gitweb_config {
- our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
- our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
- our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} || "++GITWEB_CONFIG_COMMON++";
+ our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "@GITWEB_CONFIG@";
+ our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "@GITWEB_CONFIG_SYSTEM@";
+ our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} || "@GITWEB_CONFIG_COMMON@";
# Protect against duplications of file names, to not read config twice.
# Only one of $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM is used, so
@@ -2094,7 +2094,7 @@ sub format_log_line_html {
(
# The output of "git describe", e.g. v2.10.0-297-gf6727b0
# or hadoop-20160921-113441-20-g094fb7d
- (?<!-) # see strbuf_check_tag_ref(). Tags can't start with -
+ (?<!-) # see check_tag_ref(). Tags can't start with -
[A-Za-z0-9.-]+
(?!\.) # refs can't end with ".", see check_refname_format()
-g$regex
diff --git a/gitweb/meson.build b/gitweb/meson.build
new file mode 100644
index 0000000000..89b403dc9d
--- /dev/null
+++ b/gitweb/meson.build
@@ -0,0 +1,89 @@
+gitweb_config = configuration_data()
+gitweb_config.set_quoted('PERL_PATH', perl.full_path())
+gitweb_config.set_quoted('CSSMIN', '')
+gitweb_config.set_quoted('JSMIN', '')
+gitweb_config.set_quoted('GIT_BINDIR', get_option('prefix') / get_option('bindir'))
+gitweb_config.set_quoted('GITWEB_CONFIG', get_option('gitweb_config'))
+gitweb_config.set_quoted('GITWEB_CONFIG_SYSTEM', get_option('gitweb_config_system'))
+gitweb_config.set_quoted('GITWEB_CONFIG_COMMON', get_option('gitweb_config_common'))
+gitweb_config.set_quoted('GITWEB_HOME_LINK_STR', get_option('gitweb_home_link_str'))
+gitweb_config.set_quoted('GITWEB_SITENAME', get_option('gitweb_sitename'))
+gitweb_config.set_quoted('GITWEB_PROJECTROOT', get_option('gitweb_projectroot'))
+gitweb_config.set_quoted('GITWEB_PROJECT_MAXDEPTH', get_option('gitweb_project_maxdepth'))
+gitweb_config.set_quoted('GITWEB_EXPORT_OK', get_option('gitweb_export_ok'))
+gitweb_config.set_quoted('GITWEB_STRICT_EXPORT', get_option('gitweb_strict_export'))
+gitweb_config.set_quoted('GITWEB_BASE_URL', get_option('gitweb_base_url'))
+gitweb_config.set_quoted('GITWEB_LIST', get_option('gitweb_list'))
+gitweb_config.set_quoted('GITWEB_HOMETEXT', get_option('gitweb_hometext'))
+gitweb_config.set_quoted('GITWEB_CSS', get_option('gitweb_css'))
+gitweb_config.set_quoted('GITWEB_LOGO', get_option('gitweb_logo'))
+gitweb_config.set_quoted('GITWEB_FAVICON', get_option('gitweb_favicon'))
+gitweb_config.set_quoted('GITWEB_JS', get_option('gitweb_js'))
+gitweb_config.set_quoted('GITWEB_SITE_HTML_HEAD_STRING', get_option('gitweb_site_html_head_string'))
+gitweb_config.set_quoted('GITWEB_SITE_HEADER', get_option('gitweb_site_header'))
+gitweb_config.set_quoted('GITWEB_SITE_FOOTER', get_option('gitweb_site_footer'))
+gitweb_config.set_quoted('HIGHLIGHT_BIN', get_option('highlight_bin'))
+
+configure_file(
+ input: 'GITWEB-BUILD-OPTIONS.in',
+ output: 'GITWEB-BUILD-OPTIONS',
+ configuration: gitweb_config,
+)
+
+test_dependencies += custom_target(
+ input: 'gitweb.perl',
+ output: 'gitweb.cgi',
+ command: [
+ shell,
+ meson.current_source_dir() / 'generate-gitweb-cgi.sh',
+ meson.current_build_dir() / 'GITWEB-BUILD-OPTIONS',
+ git_version_file.full_path(),
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ install: true,
+ install_dir: get_option('datadir') / 'gitweb',
+ depends: [git_version_file],
+)
+
+javascript_files = [
+ meson.current_source_dir() / 'static/js/adjust-timezone.js',
+ meson.current_source_dir() / 'static/js/blame_incremental.js',
+ meson.current_source_dir() / 'static/js/javascript-detection.js',
+ meson.current_source_dir() / 'static/js/lib/common-lib.js',
+ meson.current_source_dir() / 'static/js/lib/cookies.js',
+ meson.current_source_dir() / 'static/js/lib/datetime.js',
+]
+
+test_dependencies += custom_target(
+ input: javascript_files,
+ output: 'gitweb.js',
+ command: [
+ shell,
+ meson.current_source_dir() / 'generate-gitweb-js.sh',
+ '@OUTPUT@',
+ ] + javascript_files,
+ install: true,
+ install_dir: get_option('datadir') / 'gitweb/static',
+)
+
+foreach asset : [
+ 'static/git-favicon.png',
+ 'static/git-logo.png',
+ 'static/gitweb.css',
+]
+ if meson.version().version_compare('>=1.3.0')
+ fs.copyfile(asset,
+ install: true,
+ install_dir: get_option('datadir') / 'gitweb' / fs.parent(asset),
+ )
+ else
+ configure_file(
+ input: asset,
+ output: fs.stem(asset),
+ copy: true,
+ install: true,
+ install_dir: get_option('datadir') / 'gitweb' / fs.parent(asset),
+ )
+ endif
+endforeach
diff --git a/gpg-interface.c b/gpg-interface.c
index 07335987a6..0896458de5 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -127,9 +127,7 @@ static struct gpg_format *use_format = &gpg_format[0];
static struct gpg_format *get_format_by_name(const char *str)
{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(gpg_format); i++)
+ for (size_t i = 0; i < ARRAY_SIZE(gpg_format); i++)
if (!strcmp(gpg_format[i].name, str))
return gpg_format + i;
return NULL;
@@ -137,9 +135,9 @@ static struct gpg_format *get_format_by_name(const char *str)
static struct gpg_format *get_format_by_sig(const char *sig)
{
- int i, j;
+ int j;
- for (i = 0; i < ARRAY_SIZE(gpg_format); i++)
+ for (size_t i = 0; i < ARRAY_SIZE(gpg_format); i++)
for (j = 0; gpg_format[i].sigs[j]; j++)
if (starts_with(sig, gpg_format[i].sigs[j]))
return gpg_format + i;
@@ -227,7 +225,7 @@ static void parse_gpg_output(struct signature_check *sigc)
{
const char *buf = sigc->gpg_status;
const char *line, *next;
- int i, j;
+ int j;
int seen_exclusive_status = 0;
/* Iterate over all lines */
@@ -242,7 +240,7 @@ static void parse_gpg_output(struct signature_check *sigc)
continue;
/* Iterate over all search strings */
- for (i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
if (skip_prefix(line, sigcheck_gpg_status[i].check, &line)) {
/*
* GOODSIG, BADSIG etc. can occur only once for
@@ -699,7 +697,7 @@ size_t parse_signed_buffer(const char *buf, size_t size)
match = len;
eol = memchr(buf + len, '\n', size - len);
- len += eol ? eol - (buf + len) + 1 : size - len;
+ len += eol ? (size_t) (eol - (buf + len) + 1) : size - len;
}
return match;
}
diff --git a/graph.c b/graph.c
index bf000fdbe1..26f6fbf000 100644
--- a/graph.c
+++ b/graph.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
@@ -350,7 +350,7 @@ struct git_graph *graph_init(struct rev_info *opt)
if (!column_colors) {
char *string;
- if (git_config_get_string("log.graphcolors", &string)) {
+ if (repo_config_get_string(opt->repo, "log.graphcolors", &string)) {
/* not configured -- use default */
graph_set_column_colors(column_colors_ansi,
column_colors_ansi_max);
diff --git a/grep.c b/grep.c
index e95cded414..4e155ee9e6 100644
--- a/grep.c
+++ b/grep.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "gettext.h"
diff --git a/help.c b/help.c
index 8a830ba35c..5483ea8fd2 100644
--- a/help.c
+++ b/help.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/help.h b/help.h
index 67207b3073..c54bf0977d 100644
--- a/help.h
+++ b/help.h
@@ -60,8 +60,7 @@ static inline void list_config_item(struct string_list *list,
#define define_list_config_array(array) \
void list_config_##array(struct string_list *list, const char *prefix) \
{ \
- int i; \
- for (i = 0; i < ARRAY_SIZE(array); i++) \
+ for (size_t i = 0; i < ARRAY_SIZE(array); i++) \
if (array[i]) \
list_config_item(list, prefix, array[i]); \
} \
@@ -70,11 +69,10 @@ struct string_list
#define define_list_config_array_extra(array, values) \
void list_config_##array(struct string_list *list, const char *prefix) \
{ \
- int i; \
static const char *extra[] = values; \
- for (i = 0; i < ARRAY_SIZE(extra); i++) \
+ for (size_t i = 0; i < ARRAY_SIZE(extra); i++) \
list_config_item(list, prefix, extra[i]); \
- for (i = 0; i < ARRAY_SIZE(array); i++) \
+ for (size_t i = 0; i < ARRAY_SIZE(array); i++) \
if (array[i]) \
list_config_item(list, prefix, array[i]); \
} \
diff --git a/hex.c b/hex.c
index 5ca78a7744..865a232167 100644
--- a/hex.c
+++ b/hex.c
@@ -7,8 +7,7 @@
static int get_hash_hex_algop(const char *hex, unsigned char *hash,
const struct git_hash_algo *algop)
{
- int i;
- for (i = 0; i < algop->rawsz; i++) {
+ for (size_t i = 0; i < algop->rawsz; i++) {
int val = hex2chr(hex);
if (val < 0)
return -1;
@@ -83,7 +82,6 @@ char *hash_to_hex_algop_r(char *buffer, const unsigned char *hash,
{
static const char hex[] = "0123456789abcdef";
char *buf = buffer;
- int i;
/*
* Our struct object_id has been memset to 0, so default to printing
@@ -92,7 +90,7 @@ char *hash_to_hex_algop_r(char *buffer, const unsigned char *hash,
if (algop == &hash_algos[0])
algop = the_hash_algo;
- for (i = 0; i < algop->rawsz; i++) {
+ for (size_t i = 0; i < algop->rawsz; i++) {
unsigned int val = *hash++;
*buf++ = hex[val >> 4];
*buf++ = hex[val & 0xf];
diff --git a/hook.c b/hook.c
index a9320cb0ce..9ddbdee06d 100644
--- a/hook.c
+++ b/hook.c
@@ -39,7 +39,7 @@ const char *find_hook(struct repository *r, const char *name)
advise(_("The '%s' hook was ignored because "
"it's not set as executable.\n"
"You can disable this warning with "
- "`git config advice.ignoredHook false`."),
+ "`git config set advice.ignoredHook false`."),
path.buf);
}
}
diff --git a/http-backend.c b/http-backend.c
index 73eec4ea3d..33cf378282 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/http-push.c b/http-push.c
index 4d24e6b8d4..43da1c7cd3 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1338,7 +1338,6 @@ static struct object_list **process_tree(struct tree *tree,
static int get_delta(struct rev_info *revs, struct remote_lock *lock)
{
- int i;
struct commit *commit;
struct object_list **p = &objects;
int count = 0;
@@ -1351,7 +1350,7 @@ static int get_delta(struct rev_info *revs, struct remote_lock *lock)
count += add_send_request(&commit->object, lock);
}
- for (i = 0; i < revs->pending.nr; i++) {
+ for (size_t i = 0; i < revs->pending.nr; i++) {
struct object_array_entry *entry = revs->pending.objects + i;
struct object *obj = entry->item;
const char *name = entry->name;
diff --git a/http-walker.c b/http-walker.c
index 43cde0ebe5..7918ddc096 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "repository.h"
diff --git a/http.c b/http.c
index bc64e57799..f08b2ae474 100644
--- a/http.c
+++ b/http.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "git-curl-compat.h"
@@ -608,7 +609,7 @@ static void init_curl_http_auth(CURL *result)
}
}
- credential_fill(&http_auth, 1);
+ credential_fill(the_repository, &http_auth, 1);
if (http_auth.password) {
if (always_auth_proactively()) {
@@ -651,7 +652,7 @@ static void init_curl_proxy_auth(CURL *result)
{
if (proxy_auth.username) {
if (!proxy_auth.password && !proxy_auth.credential)
- credential_fill(&proxy_auth, 1);
+ credential_fill(the_repository, &proxy_auth, 1);
set_proxyauth_name_password(result);
}
@@ -685,7 +686,7 @@ static int has_cert_password(void)
cert_auth.host = xstrdup("");
cert_auth.username = xstrdup("");
cert_auth.path = xstrdup(ssl_cert);
- credential_fill(&cert_auth, 0);
+ credential_fill(the_repository, &cert_auth, 0);
}
return 1;
}
@@ -699,7 +700,7 @@ static int has_proxy_cert_password(void)
proxy_cert_auth.host = xstrdup("");
proxy_cert_auth.username = xstrdup("");
proxy_cert_auth.path = xstrdup(http_proxy_ssl_cert);
- credential_fill(&proxy_cert_auth, 0);
+ credential_fill(the_repository, &proxy_cert_auth, 0);
}
return 1;
}
@@ -1783,9 +1784,9 @@ static int handle_curl_result(struct slot_results *results)
curl_errorstr, sizeof(curl_errorstr));
if (results->curl_result == CURLE_OK) {
- credential_approve(&http_auth);
- credential_approve(&proxy_auth);
- credential_approve(&cert_auth);
+ credential_approve(the_repository, &http_auth);
+ credential_approve(the_repository, &proxy_auth);
+ credential_approve(the_repository, &cert_auth);
return HTTP_OK;
} else if (results->curl_result == CURLE_SSL_CERTPROBLEM) {
/*
@@ -1794,7 +1795,7 @@ static int handle_curl_result(struct slot_results *results)
* with the certificate. So we reject the credential to
* avoid caching or saving a bad password.
*/
- credential_reject(&cert_auth);
+ credential_reject(the_repository, &cert_auth);
return HTTP_NOAUTH;
} else if (results->curl_result == CURLE_SSL_PINNEDPUBKEYNOTMATCH) {
return HTTP_NOMATCHPUBLICKEY;
@@ -1807,7 +1808,7 @@ static int handle_curl_result(struct slot_results *results)
credential_clear_secrets(&http_auth);
return HTTP_REAUTH;
}
- credential_reject(&http_auth);
+ credential_reject(the_repository, &http_auth);
if (always_auth_proactively())
http_proactive_auth = PROACTIVE_AUTH_NONE;
return HTTP_NOAUTH;
@@ -1821,7 +1822,7 @@ static int handle_curl_result(struct slot_results *results)
}
} else {
if (results->http_connectcode == 407)
- credential_reject(&proxy_auth);
+ credential_reject(the_repository, &proxy_auth);
if (!curl_errorstr[0])
strlcpy(curl_errorstr,
curl_easy_strerror(results->curl_result),
@@ -2209,7 +2210,7 @@ static int http_request_reauth(const char *url,
int ret;
if (always_auth_proactively())
- credential_fill(&http_auth, 1);
+ credential_fill(the_repository, &http_auth, 1);
ret = http_request(url, result, target, options);
@@ -2250,7 +2251,7 @@ static int http_request_reauth(const char *url,
BUG("Unknown http_request target");
}
- credential_fill(&http_auth, 1);
+ credential_fill(the_repository, &http_auth, 1);
ret = http_request(url, result, target, options);
}
@@ -2381,7 +2382,7 @@ static int fetch_and_setup_pack_index(struct packed_git **packs_head,
if (!tmp_idx)
return -1;
- new_pack = parse_pack_index(sha1, tmp_idx);
+ new_pack = parse_pack_index(the_repository, sha1, tmp_idx);
if (!new_pack) {
unlink(tmp_idx);
free(tmp_idx);
@@ -2523,7 +2524,7 @@ struct http_pack_request *new_direct_http_pack_request(
preq->url = url;
- odb_pack_name(&preq->tmpfile, packed_git_hash, "pack");
+ odb_pack_name(the_repository, &preq->tmpfile, packed_git_hash, "pack");
strbuf_addstr(&preq->tmpfile, ".temp");
preq->packfile = fopen(preq->tmpfile.buf, "a");
if (!preq->packfile) {
diff --git a/imap-send.c b/imap-send.c
index 25c68fd90d..6c8f84e836 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -22,6 +22,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -921,7 +922,7 @@ static void server_fill_credential(struct imap_server_conf *srvc, struct credent
cred->username = xstrdup_or_null(srvc->user);
cred->password = xstrdup_or_null(srvc->pass);
- credential_fill(cred, 1);
+ credential_fill(the_repository, cred, 1);
if (!srvc->user)
srvc->user = xstrdup(cred->username);
@@ -1122,7 +1123,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
} /* !preauth */
if (cred.username)
- credential_approve(&cred);
+ credential_approve(the_repository, &cred);
credential_clear(&cred);
/* check the target mailbox exists */
@@ -1149,7 +1150,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
bail:
if (cred.username)
- credential_reject(&cred);
+ credential_reject(the_repository, &cred);
credential_clear(&cred);
out:
@@ -1491,9 +1492,9 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
if (cred.username) {
if (res == CURLE_OK)
- credential_approve(&cred);
+ credential_approve(the_repository, &cred);
else if (res == CURLE_LOGIN_DENIED)
- credential_reject(&cred);
+ credential_reject(the_repository, &cred);
}
credential_clear(&cred);
diff --git a/json-writer.c b/json-writer.c
index 25b9201f9c..8c5187e9fd 100644
--- a/json-writer.c
+++ b/json-writer.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "json-writer.h"
diff --git a/kwset.c b/kwset.c
index 695e47b7cc..1714eada60 100644
--- a/kwset.c
+++ b/kwset.c
@@ -32,6 +32,8 @@
String Matching: An Aid to Bibliographic Search," CACM June 1975,
Vol. 18, No. 6, which describes the failure function used below. */
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "kwset.h"
diff --git a/line-log.c b/line-log.c
index bc67b75d10..628e3fe3ae 100644
--- a/line-log.c
+++ b/line-log.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "diffcore.h"
#include "line-range.h"
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index fa72e81e4a..948376d42d 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -394,8 +394,6 @@ void list_objects_filter_copy(
struct list_objects_filter_options *dest,
const struct list_objects_filter_options *src)
{
- int i;
-
/* Copy everything. We will overwrite the pointers shortly. */
memcpy(dest, src, sizeof(struct list_objects_filter_options));
@@ -404,7 +402,7 @@ void list_objects_filter_copy(
dest->sparse_oid_name = xstrdup_or_null(src->sparse_oid_name);
ALLOC_ARRAY(dest->sub, dest->sub_alloc);
- for (i = 0; i < src->sub_nr; i++)
+ for (size_t i = 0; i < src->sub_nr; i++)
list_objects_filter_copy(&dest->sub[i], &src->sub[i]);
}
diff --git a/list-objects.c b/list-objects.c
index 985d008799..943e62e868 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -41,7 +41,8 @@ static void show_object(struct traversal_context *ctx,
{
if (!ctx->show_object)
return;
- if (ctx->revs->unpacked && has_object_pack(&object->oid))
+ if (ctx->revs->unpacked && has_object_pack(ctx->revs->repo,
+ &object->oid))
return;
ctx->show_object(object, name, ctx->show_data);
@@ -74,7 +75,7 @@ static void process_blob(struct traversal_context *ctx,
*/
if (ctx->revs->exclude_promisor_objects &&
!repo_has_object_file(the_repository, &obj->oid) &&
- is_promisor_object(&obj->oid))
+ is_promisor_object(ctx->revs->repo, &obj->oid))
return;
pathlen = path->len;
@@ -179,7 +180,7 @@ static void process_tree(struct traversal_context *ctx,
* an incomplete list of missing objects.
*/
if (revs->exclude_promisor_objects &&
- is_promisor_object(&obj->oid))
+ is_promisor_object(revs->repo, &obj->oid))
return;
if (!revs->do_not_die_on_missing_objects)
@@ -283,7 +284,6 @@ void mark_edges_uninteresting(struct rev_info *revs,
int sparse)
{
struct commit_list *list;
- int i;
if (sparse) {
struct oidset set;
@@ -320,7 +320,7 @@ void mark_edges_uninteresting(struct rev_info *revs,
}
if (revs->edge_hint_aggressive) {
- for (i = 0; i < revs->cmdline.nr; i++) {
+ for (size_t i = 0; i < revs->cmdline.nr; i++) {
struct object *obj = revs->cmdline.rev[i].item;
struct commit *commit = (struct commit *)obj;
if (obj->type != OBJ_COMMIT || !(obj->flags & UNINTERESTING))
@@ -343,11 +343,9 @@ static void add_pending_tree(struct rev_info *revs, struct tree *tree)
static void traverse_non_commits(struct traversal_context *ctx,
struct strbuf *base)
{
- int i;
-
assert(base->len == 0);
- for (i = 0; i < ctx->revs->pending.nr; i++) {
+ for (size_t i = 0; i < ctx->revs->pending.nr; i++) {
struct object_array_entry *pending = ctx->revs->pending.objects + i;
struct object *obj = pending->item;
const char *name = pending->name;
diff --git a/log-tree.c b/log-tree.c
index 83cc4b1cfb..8b184d6776 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "commit-reach.h"
@@ -1041,7 +1042,7 @@ static int do_remerge_diff(struct rev_info *opt,
* into the alternative object store list as the primary.
*/
if (opt->remerge_diff && !opt->remerge_objdir) {
- opt->remerge_objdir = tmp_objdir_create("remerge-diff");
+ opt->remerge_objdir = tmp_objdir_create(the_repository, "remerge-diff");
if (!opt->remerge_objdir)
return error(_("unable to create temporary object directory"));
tmp_objdir_replace_primary_odb(opt->remerge_objdir, 1);
diff --git a/ls-refs.c b/ls-refs.c
index c824aea714..e28c841375 100644
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -53,12 +53,10 @@ static enum {
*/
static int ref_match(const struct strvec *prefixes, const char *refname)
{
- int i;
-
if (!prefixes->nr)
return 1; /* no restriction */
- for (i = 0; i < prefixes->nr; i++) {
+ for (size_t i = 0; i < prefixes->nr; i++) {
const char *prefix = prefixes->v[i];
if (starts_with(refname, prefix))
diff --git a/mailinfo.c b/mailinfo.c
index d1f42bd7e3..7b001fa5db 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -1268,7 +1268,7 @@ static int git_mailinfo_config(const char *var, const char *value,
return 0;
}
-void setup_mailinfo(struct mailinfo *mi)
+void setup_mailinfo(struct repository *r, struct mailinfo *mi)
{
memset(mi, 0, sizeof(*mi));
strbuf_init(&mi->name, 0);
@@ -1280,7 +1280,7 @@ void setup_mailinfo(struct mailinfo *mi)
mi->header_stage = 1;
mi->use_inbody_headers = 1;
mi->content_top = mi->content;
- git_config(git_mailinfo_config, mi);
+ repo_config(r, git_mailinfo_config, mi);
}
void clear_mailinfo(struct mailinfo *mi)
diff --git a/mailinfo.h b/mailinfo.h
index f2ffd0349e..1f20664165 100644
--- a/mailinfo.h
+++ b/mailinfo.h
@@ -5,6 +5,8 @@
#define MAX_BOUNDARIES 5
+struct repository;
+
enum quoted_cr_action {
quoted_cr_unset = -1,
quoted_cr_nowarn,
@@ -49,7 +51,7 @@ struct mailinfo {
};
int mailinfo_parse_quoted_cr_action(const char *actionstr, int *action);
-void setup_mailinfo(struct mailinfo *);
+void setup_mailinfo(struct repository *r, struct mailinfo *);
int mailinfo(struct mailinfo *, const char *msg, const char *patch);
void clear_mailinfo(struct mailinfo *);
diff --git a/mailmap.c b/mailmap.c
index 9f9fa3199a..f35d20ed7f 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
diff --git a/match-trees.c b/match-trees.c
index 147b03abf1..ef14ceb594 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "hex.h"
@@ -7,6 +7,7 @@
#include "tree.h"
#include "tree-walk.h"
#include "object-store-ll.h"
+#include "repository.h"
static int score_missing(unsigned mode)
{
@@ -53,14 +54,15 @@ static int score_matches(unsigned mode1, unsigned mode2)
return score;
}
-static void *fill_tree_desc_strict(struct tree_desc *desc,
+static void *fill_tree_desc_strict(struct repository *r,
+ struct tree_desc *desc,
const struct object_id *hash)
{
void *buffer;
enum object_type type;
unsigned long size;
- buffer = repo_read_object_file(the_repository, hash, &type, &size);
+ buffer = repo_read_object_file(r, hash, &type, &size);
if (!buffer)
die("unable to read tree (%s)", oid_to_hex(hash));
if (type != OBJ_TREE)
@@ -79,12 +81,13 @@ static int base_name_entries_compare(const struct name_entry *a,
/*
* Inspect two trees, and give a score that tells how similar they are.
*/
-static int score_trees(const struct object_id *hash1, const struct object_id *hash2)
+static int score_trees(struct repository *r,
+ const struct object_id *hash1, const struct object_id *hash2)
{
struct tree_desc one;
struct tree_desc two;
- void *one_buf = fill_tree_desc_strict(&one, hash1);
- void *two_buf = fill_tree_desc_strict(&two, hash2);
+ void *one_buf = fill_tree_desc_strict(r, &one, hash1);
+ void *two_buf = fill_tree_desc_strict(r, &two, hash2);
int score = 0;
for (;;) {
@@ -132,7 +135,8 @@ static int score_trees(const struct object_id *hash1, const struct object_id *ha
/*
* Match one itself and its subtrees with two and pick the best match.
*/
-static void match_trees(const struct object_id *hash1,
+static void match_trees(struct repository *r,
+ const struct object_id *hash1,
const struct object_id *hash2,
int *best_score,
char **best_match,
@@ -140,7 +144,7 @@ static void match_trees(const struct object_id *hash1,
int recurse_limit)
{
struct tree_desc one;
- void *one_buf = fill_tree_desc_strict(&one, hash1);
+ void *one_buf = fill_tree_desc_strict(r, &one, hash1);
while (one.size) {
const char *path;
@@ -151,7 +155,7 @@ static void match_trees(const struct object_id *hash1,
elem = tree_entry_extract(&one, &path, &mode);
if (!S_ISDIR(mode))
goto next;
- score = score_trees(elem, hash2);
+ score = score_trees(r, elem, hash2);
if (*best_score < score) {
free(*best_match);
*best_match = xstrfmt("%s%s", base, path);
@@ -159,7 +163,7 @@ static void match_trees(const struct object_id *hash1,
}
if (recurse_limit) {
char *newbase = xstrfmt("%s%s/", base, path);
- match_trees(elem, hash2, best_score, best_match,
+ match_trees(r, elem, hash2, best_score, best_match,
newbase, recurse_limit - 1);
free(newbase);
}
@@ -174,7 +178,8 @@ static void match_trees(const struct object_id *hash1,
* A tree "oid1" has a subdirectory at "prefix". Come up with a tree object by
* replacing it with another tree "oid2".
*/
-static int splice_tree(const struct object_id *oid1, const char *prefix,
+static int splice_tree(struct repository *r,
+ const struct object_id *oid1, const char *prefix,
const struct object_id *oid2, struct object_id *result)
{
char *subpath;
@@ -193,7 +198,7 @@ static int splice_tree(const struct object_id *oid1, const char *prefix,
if (*subpath)
subpath++;
- buf = repo_read_object_file(the_repository, oid1, &type, &sz);
+ buf = repo_read_object_file(r, oid1, &type, &sz);
if (!buf)
die("cannot read tree %s", oid_to_hex(oid1));
init_tree_desc(&desc, oid1, buf, sz);
@@ -231,15 +236,15 @@ static int splice_tree(const struct object_id *oid1, const char *prefix,
oid_to_hex(oid1));
if (*subpath) {
struct object_id tree_oid;
- oidread(&tree_oid, rewrite_here, the_repository->hash_algo);
- status = splice_tree(&tree_oid, subpath, oid2, &subtree);
+ oidread(&tree_oid, rewrite_here, r->hash_algo);
+ status = splice_tree(r, &tree_oid, subpath, oid2, &subtree);
if (status)
return status;
rewrite_with = &subtree;
} else {
rewrite_with = oid2;
}
- hashcpy(rewrite_here, rewrite_with->hash, the_repository->hash_algo);
+ hashcpy(rewrite_here, rewrite_with->hash, r->hash_algo);
status = write_object_file(buf, sz, OBJ_TREE, result);
free(buf);
return status;
@@ -270,7 +275,7 @@ void shift_tree(struct repository *r,
if (!depth_limit)
depth_limit = 2;
- add_score = del_score = score_trees(hash1, hash2);
+ add_score = del_score = score_trees(r, hash1, hash2);
add_prefix = xcalloc(1, 1);
del_prefix = xcalloc(1, 1);
@@ -278,13 +283,13 @@ void shift_tree(struct repository *r,
* See if one's subtree resembles two; if so we need to prefix
* two with a few fake trees to match the prefix.
*/
- match_trees(hash1, hash2, &add_score, &add_prefix, "", depth_limit);
+ match_trees(r, hash1, hash2, &add_score, &add_prefix, "", depth_limit);
/*
* See if two's subtree resembles one; if so we need to
* pick only subtree of two.
*/
- match_trees(hash2, hash1, &del_score, &del_prefix, "", depth_limit);
+ match_trees(r, hash2, hash1, &del_score, &del_prefix, "", depth_limit);
/* Assume we do not have to do any shifting */
oidcpy(shifted, hash2);
@@ -305,7 +310,7 @@ void shift_tree(struct repository *r,
if (!*add_prefix)
goto out;
- splice_tree(hash1, add_prefix, hash2, shifted);
+ splice_tree(r, hash1, add_prefix, hash2, shifted);
out:
free(add_prefix);
@@ -339,16 +344,16 @@ void shift_tree_by(struct repository *r,
if (candidate == 3) {
/* Both are plausible -- we need to evaluate the score */
- int best_score = score_trees(hash1, hash2);
+ int best_score = score_trees(r, hash1, hash2);
int score;
candidate = 0;
- score = score_trees(&sub1, hash2);
+ score = score_trees(r, &sub1, hash2);
if (score > best_score) {
candidate = 1;
best_score = score;
}
- score = score_trees(&sub2, hash1);
+ score = score_trees(r, &sub2, hash1);
if (score > best_score)
candidate = 2;
}
@@ -364,7 +369,7 @@ void shift_tree_by(struct repository *r,
* shift tree2 down by adding shift_prefix above it
* to match tree1.
*/
- splice_tree(hash1, shift_prefix, hash2, shifted);
+ splice_tree(r, hash1, shift_prefix, hash2, shifted);
else
/*
* shift tree2 up by removing shift_prefix from it
diff --git a/mem-pool.c b/mem-pool.c
index a3ba38831d..62441dcc71 100644
--- a/mem-pool.c
+++ b/mem-pool.c
@@ -2,6 +2,8 @@
* Memory Pool implementation logic.
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "mem-pool.h"
#include "gettext.h"
diff --git a/merge-ll.c b/merge-ll.c
index 62fc625552..b2dc26da4f 100644
--- a/merge-ll.c
+++ b/merge-ll.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/merge-ort.c b/merge-ort.c
index 11029c10be..46e78c3ffa 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -15,6 +15,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "merge-ort.h"
diff --git a/merge-recursive.c b/merge-recursive.c
index ed64a4c537..5dfaf32b2c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "merge-recursive.h"
diff --git a/merge.c b/merge.c
index fe3efa4b24..5ecaf508e4 100644
--- a/merge.c
+++ b/merge.c
@@ -25,11 +25,11 @@ int try_merge_command(struct repository *r,
const char *head_arg, struct commit_list *remotes)
{
struct child_process cmd = CHILD_PROCESS_INIT;
- int i, ret;
+ int ret;
struct commit_list *j;
strvec_pushf(&cmd.args, "merge-%s", strategy);
- for (i = 0; i < xopts_nr; i++)
+ for (size_t i = 0; i < xopts_nr; i++)
strvec_pushf(&cmd.args, "--%s", xopts[i]);
for (j = common; j; j = j->next)
strvec_push(&cmd.args, merge_argument(j->item));
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000000..548eac62b2
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,1955 @@
+# Meson build system
+# ==================
+#
+# The Meson build system is an alternative to our Makefile that you can use to
+# build, test and install Git. Using Meson results in a couple of benefits:
+#
+# - Out-of-tree builds.
+# - Better integration into IDEs.
+# - Easy-to-use autoconfiguration of available features on your system.
+#
+# To use Meson from the command line you need to have both Meson and Ninja
+# installed. Alternatively, if you do not have Python available on your system,
+# you can also use Muon instead of Meson and Samurai instead of Ninja, both of
+# which are drop-ins replacement that only depend on C.
+#
+# Basic usage
+# ===========
+#
+# In the most trivial case, you can configure, build and install Git like this:
+#
+# 1. Set up the build directory. This only needs to happen once per build
+# directory you want to have. You can also configure multiple different
+# build directories with different configurations.
+#
+# $ meson setup build/
+#
+# The build directory gets ignored by Git automatically as Meson will write
+# a ".gitignore" file into it. From hereon, we will assume that you execute
+# commands inside this build directory.
+#
+# 2. Compile Git. You can either use Meson, Ninja or Samurai to do this, so all
+# of the following invocations are equivalent:
+#
+# $ meson compile
+# $ ninja
+# $ samu
+#
+# The different invocations should ultimately not make much of a difference.
+# Using Meson also works with other generators though, like when the build
+# directory has been set up for use with Microsoft Visual Studio.
+#
+# Ninja and Samurai use multiple jobs by default, scaling with the number of
+# processor cores available. You can pass the `-jN` flag to change this.
+#
+# Meson automatically picks up ccache and sccache when these are installed
+# when setting up the build directory. You can override this behaviour when
+# setting up the build directory by setting the `CC` environment variable to
+# your desired compiler.
+#
+# 3. Execute tests. Again, you can either use Meson, Ninja or Samurai to do this:
+#
+# $ meson test
+# $ ninja test
+# $ samu test
+#
+# It is recommended to use Meson in this case though as it also provides you
+# additional features that the other build systems don't have available.
+# You can e.g. pass additional arguments to the test executables or run
+# individual tests:
+#
+# # Execute the t0000-basic integration test and t-reftable-stack unit test.
+# $ meson test t0000-basic t-reftable-stack
+#
+# # Execute all reftable unit tests.
+# $ meson test t-reftable-*
+#
+# # Execute all tests and stop with the first failure.
+# $ meson test --maxfail 1
+#
+# # Execute single test interactively such that features like `debug ()` work.
+# $ meson test -i --test-args='-ix' t1400-update-ref
+#
+# Test execution is parallelized by default and scales with the number of
+# processor cores available. You can change the number of processes by passing
+# the `-jN` flag to `meson test`.
+#
+# 4. Install the Git distribution. Again, this can be done via Meson, Ninja or
+# Samurai:
+#
+# $ meson install
+# $ ninja install
+# $ samu install
+#
+# The prefix into which Git shall be installed is defined when setting up
+# the build directory. More on that in the "Configuration" section.
+#
+# Meson supports multiple backends. The default backend generates Ninja build
+# instructions, but it also supports the generation of Microsoft Visual
+# Studio solutions as well as Xcode projects by passing the `--backend` option
+# to `meson setup`. IDEs like Eclipse and Visual Studio Code provide plugins to
+# import Meson files directly.
+#
+# Configuration
+# =============
+#
+# The exact configuration of Git is determined when setting up the build
+# directory via `meson setup`. Unless told otherwise, Meson will automatically
+# detect the availability of various bits and pieces. There are two different
+# kinds of options that can be used to further tweak the build:
+#
+# - Built-in options provided by Meson.
+#
+# - Options defined by the project in the "meson_options.txt" file.
+#
+# Both kinds of options can be inspected by running `meson configure` in the
+# build directory, which will give you a list of the current value for all
+# options.
+#
+# Options can be configured either when setting up the build directory or can
+# be changed in preexisting build directories:
+#
+# # Set up a new build directory with optimized settings that will be
+# # installed into an alternative prefix.
+# $ meson setup --buildtype release --optimization 3 --strip --prefix=/home/$USER build
+#
+# # Set up a new build directory with a higher warning level. Level 2 is
+# # mostly equivalent to setting DEVELOPER=1, level 3 and "everything"
+# # will enable even more warnings.
+# $ meson setup -Dwarning_level=2 build
+#
+# # Set up a new build directory with 'address' and 'undefined' sanitizers
+# # using Clang.
+# $ CC=clang meson setup -Db_sanitize=address,undefined build
+#
+# # Disable tests in a preexisting build directory.
+# $ meson configure -Dtests=false
+#
+# # Disable features based on Python
+# $ meson configure -Dpython=disabled
+#
+# Options have a type like booleans, choices, strings or features. Features are
+# somewhat special as they can have one of three values: enabled, disabled or
+# auto. While the first two values are self-explanatory, "auto" will enable or
+# disable the feature based on the availability of prerequisites to support it.
+# Python-based features for example will be enabled automatically when a Python
+# interpreter could be found. The default value of such features can be changed
+# via `meson setup --auto-features={enabled,disabled,auto}`, which will set the
+# value of all features with a value of "auto" to the provided one by default.
+#
+# It is also possible to store a set of configuration options in machine files.
+# This can be useful in case you regularly want to reuse the same set of options:
+#
+# [binaries]
+# c = ['clang']
+# ar = ['ar']
+#
+# [project options]
+# gettext = 'disabled'
+# default_editor = 'vim'
+#
+# [built-in options]
+# b_lto = true
+# b_sanitize = 'address,undefined'
+#
+# These machine files can be passed to `meson setup` via the `--native-file`
+# option.
+#
+# Subproject wrappers
+# ===================
+#
+# Subproject wrappers are a feature provided by Meson that allows the automatic
+# fallback to a "wrapped" dependency in case the dependency is not provided by
+# the system. For example if the system is lacking curl, then Meson will use
+# "subprojects/curl.wrap" to set up curl as a subproject and compile and link
+# the dependency into Git itself. This is especially helpful on systems like
+# Windows, where you typically don't have such dependencies installed.
+#
+# The use of subproject wrappers can be disabled by executing `meson setup`
+# with the `--wrap-mode nofallback` option.
+
+project('git', 'c',
+ meson_version: '>=0.61.0',
+ version: 'v2.47.GIT',
+)
+
+fs = import('fs')
+
+program_path = []
+# Git for Windows provides all the tools we need to build Git.
+if host_machine.system() == 'windows'
+ program_path += [ 'C:/Program Files/Git/bin', 'C:/Program Files/Git/usr/bin' ]
+endif
+
+cygpath = find_program('cygpath', dirs: program_path, required: false)
+diff = find_program('diff', dirs: program_path)
+shell = find_program('sh', dirs: program_path)
+tar = find_program('tar', dirs: program_path)
+
+script_environment = environment()
+foreach tool : ['cat', 'cut', 'grep', 'sed', 'sort', 'tr', 'uname']
+ program = find_program(tool, dirs: program_path)
+ script_environment.prepend('PATH', fs.parent(program.full_path()))
+endforeach
+
+git = find_program('git', dirs: program_path, required: false)
+if git.found()
+ script_environment.prepend('PATH', fs.parent(git.full_path()))
+endif
+
+if get_option('sane_tool_path') != ''
+ script_environment.prepend('PATH', get_option('sane_tool_path'))
+endif
+
+# The environment used by GIT-VERSION-GEN. Note that we explicitly override
+# environment variables that might be set by the user. This is by design so
+# that we always use whatever Meson has configured instead of what is present
+# in the environment.
+version_gen_environment = script_environment
+version_gen_environment.set('GIT_BUILT_FROM_COMMIT', get_option('built_from_commit'))
+version_gen_environment.set('GIT_DATE', get_option('build_date'))
+version_gen_environment.set('GIT_USER_AGENT', get_option('user_agent'))
+version_gen_environment.set('GIT_VERSION', get_option('version'))
+
+compiler = meson.get_compiler('c')
+
+libgit_sources = [
+ 'abspath.c',
+ 'add-interactive.c',
+ 'add-patch.c',
+ 'advice.c',
+ 'alias.c',
+ 'alloc.c',
+ 'apply.c',
+ 'archive-tar.c',
+ 'archive-zip.c',
+ 'archive.c',
+ 'attr.c',
+ 'base85.c',
+ 'bisect.c',
+ 'blame.c',
+ 'blob.c',
+ 'bloom.c',
+ 'branch.c',
+ 'bulk-checkin.c',
+ 'bundle-uri.c',
+ 'bundle.c',
+ 'cache-tree.c',
+ 'cbtree.c',
+ 'chdir-notify.c',
+ 'checkout.c',
+ 'chunk-format.c',
+ 'color.c',
+ 'column.c',
+ 'combine-diff.c',
+ 'commit-graph.c',
+ 'commit-reach.c',
+ 'commit.c',
+ 'compat/nonblock.c',
+ 'compat/obstack.c',
+ 'compat/terminal.c',
+ 'compat/zlib-uncompress2.c',
+ 'config.c',
+ 'connect.c',
+ 'connected.c',
+ 'convert.c',
+ 'copy.c',
+ 'credential.c',
+ 'csum-file.c',
+ 'ctype.c',
+ 'date.c',
+ 'decorate.c',
+ 'delta-islands.c',
+ 'diagnose.c',
+ 'diff-delta.c',
+ 'diff-merges.c',
+ 'diff-lib.c',
+ 'diff-no-index.c',
+ 'diff.c',
+ 'diffcore-break.c',
+ 'diffcore-delta.c',
+ 'diffcore-order.c',
+ 'diffcore-pickaxe.c',
+ 'diffcore-rename.c',
+ 'diffcore-rotate.c',
+ 'dir-iterator.c',
+ 'dir.c',
+ 'editor.c',
+ 'entry.c',
+ 'environment.c',
+ 'ewah/bitmap.c',
+ 'ewah/ewah_bitmap.c',
+ 'ewah/ewah_io.c',
+ 'ewah/ewah_rlw.c',
+ 'exec-cmd.c',
+ 'fetch-negotiator.c',
+ 'fetch-pack.c',
+ 'fmt-merge-msg.c',
+ 'fsck.c',
+ 'fsmonitor.c',
+ 'fsmonitor-ipc.c',
+ 'fsmonitor-settings.c',
+ 'gettext.c',
+ 'git-zlib.c',
+ 'gpg-interface.c',
+ 'graph.c',
+ 'grep.c',
+ 'hash-lookup.c',
+ 'hashmap.c',
+ 'help.c',
+ 'hex.c',
+ 'hex-ll.c',
+ 'hook.c',
+ 'ident.c',
+ 'json-writer.c',
+ 'kwset.c',
+ 'levenshtein.c',
+ 'line-log.c',
+ 'line-range.c',
+ 'linear-assignment.c',
+ 'list-objects-filter-options.c',
+ 'list-objects-filter.c',
+ 'list-objects.c',
+ 'lockfile.c',
+ 'log-tree.c',
+ 'loose.c',
+ 'ls-refs.c',
+ 'mailinfo.c',
+ 'mailmap.c',
+ 'match-trees.c',
+ 'mem-pool.c',
+ 'merge-blobs.c',
+ 'merge-ll.c',
+ 'merge-ort.c',
+ 'merge-ort-wrappers.c',
+ 'merge-recursive.c',
+ 'merge.c',
+ 'midx.c',
+ 'midx-write.c',
+ 'name-hash.c',
+ 'negotiator/default.c',
+ 'negotiator/noop.c',
+ 'negotiator/skipping.c',
+ 'notes-cache.c',
+ 'notes-merge.c',
+ 'notes-utils.c',
+ 'notes.c',
+ 'object-file-convert.c',
+ 'object-file.c',
+ 'object-name.c',
+ 'object.c',
+ 'oid-array.c',
+ 'oidmap.c',
+ 'oidset.c',
+ 'oidtree.c',
+ 'pack-bitmap-write.c',
+ 'pack-bitmap.c',
+ 'pack-check.c',
+ 'pack-mtimes.c',
+ 'pack-objects.c',
+ 'pack-revindex.c',
+ 'pack-write.c',
+ 'packfile.c',
+ 'pager.c',
+ 'parallel-checkout.c',
+ 'parse.c',
+ 'parse-options-cb.c',
+ 'parse-options.c',
+ 'patch-delta.c',
+ 'patch-ids.c',
+ 'path.c',
+ 'path-walk.c',
+ 'pathspec.c',
+ 'pkt-line.c',
+ 'preload-index.c',
+ 'pretty.c',
+ 'prio-queue.c',
+ 'progress.c',
+ 'promisor-remote.c',
+ 'prompt.c',
+ 'protocol.c',
+ 'protocol-caps.c',
+ 'prune-packed.c',
+ 'pseudo-merge.c',
+ 'quote.c',
+ 'range-diff.c',
+ 'reachable.c',
+ 'read-cache.c',
+ 'rebase-interactive.c',
+ 'rebase.c',
+ 'ref-filter.c',
+ 'reflog-walk.c',
+ 'reflog.c',
+ 'refs.c',
+ 'refs/debug.c',
+ 'refs/files-backend.c',
+ 'refs/reftable-backend.c',
+ 'refs/iterator.c',
+ 'refs/packed-backend.c',
+ 'refs/ref-cache.c',
+ 'refspec.c',
+ 'reftable/basics.c',
+ 'reftable/error.c',
+ 'reftable/block.c',
+ 'reftable/blocksource.c',
+ 'reftable/iter.c',
+ 'reftable/merged.c',
+ 'reftable/pq.c',
+ 'reftable/reader.c',
+ 'reftable/record.c',
+ 'reftable/stack.c',
+ 'reftable/system.c',
+ 'reftable/tree.c',
+ 'reftable/writer.c',
+ 'remote.c',
+ 'replace-object.c',
+ 'repo-settings.c',
+ 'repository.c',
+ 'rerere.c',
+ 'reset.c',
+ 'resolve-undo.c',
+ 'revision.c',
+ 'run-command.c',
+ 'send-pack.c',
+ 'sequencer.c',
+ 'serve.c',
+ 'server-info.c',
+ 'setup.c',
+ 'shallow.c',
+ 'sideband.c',
+ 'sigchain.c',
+ 'sparse-index.c',
+ 'split-index.c',
+ 'stable-qsort.c',
+ 'statinfo.c',
+ 'strbuf.c',
+ 'streaming.c',
+ 'string-list.c',
+ 'strmap.c',
+ 'strvec.c',
+ 'sub-process.c',
+ 'submodule-config.c',
+ 'submodule.c',
+ 'symlinks.c',
+ 'tag.c',
+ 'tempfile.c',
+ 'thread-utils.c',
+ 'tmp-objdir.c',
+ 'trace.c',
+ 'trace2.c',
+ 'trace2/tr2_cfg.c',
+ 'trace2/tr2_cmd_name.c',
+ 'trace2/tr2_ctr.c',
+ 'trace2/tr2_dst.c',
+ 'trace2/tr2_sid.c',
+ 'trace2/tr2_sysenv.c',
+ 'trace2/tr2_tbuf.c',
+ 'trace2/tr2_tgt_event.c',
+ 'trace2/tr2_tgt_normal.c',
+ 'trace2/tr2_tgt_perf.c',
+ 'trace2/tr2_tls.c',
+ 'trace2/tr2_tmr.c',
+ 'trailer.c',
+ 'transport-helper.c',
+ 'transport.c',
+ 'tree-diff.c',
+ 'tree-walk.c',
+ 'tree.c',
+ 'unpack-trees.c',
+ 'upload-pack.c',
+ 'url.c',
+ 'urlmatch.c',
+ 'usage.c',
+ 'userdiff.c',
+ 'utf8.c',
+ 'varint.c',
+ 'versioncmp.c',
+ 'walker.c',
+ 'wildmatch.c',
+ 'worktree.c',
+ 'wrapper.c',
+ 'write-or-die.c',
+ 'ws.c',
+ 'wt-status.c',
+ 'xdiff-interface.c',
+ 'xdiff/xdiffi.c',
+ 'xdiff/xemit.c',
+ 'xdiff/xhistogram.c',
+ 'xdiff/xmerge.c',
+ 'xdiff/xpatience.c',
+ 'xdiff/xprepare.c',
+ 'xdiff/xutils.c',
+]
+
+builtin_sources = [
+ 'builtin/add.c',
+ 'builtin/am.c',
+ 'builtin/annotate.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/credential.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-packed.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/refs.c',
+ 'builtin/remote-ext.c',
+ 'builtin/remote-fd.c',
+ 'builtin/remote.c',
+ 'builtin/repack.c',
+ 'builtin/replace.c',
+ 'builtin/replay.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',
+]
+
+libgit_sources += custom_target(
+ input: 'command-list.txt',
+ output: 'command-list.h',
+ command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
+ env: script_environment,
+)
+
+libgit_sources += custom_target(
+ output: 'config-list.h',
+ command: [
+ shell,
+ meson.current_source_dir() + '/generate-configlist.sh',
+ meson.current_source_dir(),
+ '@OUTPUT@',
+ ],
+ env: script_environment,
+)
+
+libgit_sources += custom_target(
+ input: 'Documentation/githooks.txt',
+ output: 'hook-list.h',
+ command: [
+ shell,
+ meson.current_source_dir() + '/generate-hooklist.sh',
+ meson.current_source_dir(),
+ '@OUTPUT@',
+ ],
+ env: script_environment,
+)
+
+# This contains the variables for GIT-BUILD-OPTIONS, which we use to propagate
+# build options to our tests.
+build_options_config = configuration_data()
+build_options_config.set('GIT_INTEROP_MAKE_OPTS', '')
+build_options_config.set('GIT_PERF_LARGE_REPO', '')
+build_options_config.set('GIT_PERF_MAKE_COMMAND', '')
+build_options_config.set('GIT_PERF_MAKE_OPTS', '')
+build_options_config.set('GIT_PERF_REPEAT_COUNT', '')
+build_options_config.set('GIT_PERF_REPO', '')
+build_options_config.set('GIT_TEST_CMP_USE_COPIED_CONTEXT', '')
+build_options_config.set('GIT_TEST_INDEX_VERSION', '')
+build_options_config.set('GIT_TEST_OPTS', '')
+build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')
+build_options_config.set('GIT_TEST_UTF8_LOCALE', '')
+build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
+build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
+
+if get_option('sane_tool_path') != ''
+ build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\# @BROKEN_PATH_FIX@$|git_broken_path_fix "' + get_option('sane_tool_path') + '"|')
+else
+ build_options_config.set_quoted('BROKEN_PATH_FIX', '/^\# @BROKEN_PATH_FIX@$/d')
+endif
+
+test_output_directory = get_option('test_output_directory')
+if test_output_directory == ''
+ test_output_directory = meson.project_build_root() / 'test-output'
+endif
+
+# These variables are used for building libgit.a.
+libgit_c_args = [
+ '-DBINDIR="' + get_option('bindir') + '"',
+ '-DDEFAULT_EDITOR="' + get_option('default_editor') + '"',
+ '-DDEFAULT_GIT_TEMPLATE_DIR="' + get_option('datadir') / 'git-core/templates' + '"',
+ '-DDEFAULT_HELP_FORMAT="' + get_option('default_help_format') + '"',
+ '-DDEFAULT_PAGER="' + get_option('default_pager') + '"',
+ '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"',
+ '-DETC_GITCONFIG="' + get_option('gitconfig') + '"',
+ '-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"',
+ '-DGIT_EXEC_PATH="' + get_option('prefix') / get_option('libexecdir') / 'git-core"',
+ '-DGIT_HOST_CPU="' + host_machine.cpu_family() + '"',
+ '-DGIT_HTML_PATH="' + get_option('datadir') / 'doc/git-doc"',
+ '-DGIT_INFO_PATH="' + get_option('infodir') + '"',
+ '-DGIT_LOCALE_PATH="' + get_option('localedir') + '"',
+ '-DGIT_MAN_PATH="' + get_option('mandir') + '"',
+ '-DPAGER_ENV="' + get_option('pager_environment') + '"',
+ '-DSHELL_PATH="' + fs.as_posix(shell.full_path()) + '"',
+]
+libgit_include_directories = [ '.' ]
+libgit_dependencies = [ ]
+
+# Treat any warning level above 1 the same as we treat DEVELOPER=1 in our
+# Makefile.
+if get_option('warning_level') in ['2','3', 'everything'] and compiler.get_argument_syntax() == 'gcc'
+ foreach cflag : [
+ '-Wdeclaration-after-statement',
+ '-Wformat-security',
+ '-Wold-style-definition',
+ '-Woverflow',
+ '-Wpointer-arith',
+ '-Wstrict-prototypes',
+ '-Wunused',
+ '-Wvla',
+ '-Wwrite-strings',
+ '-fno-common',
+ '-Wtautological-constant-out-of-range-compare',
+ # If a function is public, there should be a prototype and the right
+ # header file should be included. If not, it should be static.
+ '-Wmissing-prototypes',
+ # These are disabled because we have these all over the place.
+ '-Wno-empty-body',
+ '-Wno-missing-field-initializers',
+ ]
+ if compiler.has_argument(cflag)
+ libgit_c_args += cflag
+ endif
+ endforeach
+endif
+
+if get_option('b_sanitize').contains('address')
+ build_options_config.set('SANITIZE_ADDRESS', 'YesCompiledWithIt')
+else
+ build_options_config.set('SANITIZE_ADDRESS', '')
+endif
+if get_option('b_sanitize').contains('leak')
+ build_options_config.set('SANITIZE_LEAK', 'YesCompiledWithIt')
+else
+ build_options_config.set('SANITIZE_LEAK', '')
+endif
+if get_option('b_sanitize').contains('undefined')
+ libgit_c_args += '-DSHA1DC_FORCE_ALIGNED_ACCESS'
+endif
+
+executable_suffix = ''
+if host_machine.system() == 'cygwin' or host_machine.system() == 'windows'
+ executable_suffix = '.exe'
+ libgit_c_args += '-DSTRIP_EXTENSION="' + executable_suffix + '"'
+endif
+build_options_config.set_quoted('X', executable_suffix)
+
+python = import('python').find_installation('python3', required: get_option('python'))
+if python.found()
+ build_options_config.set('NO_PYTHON', '')
+else
+ libgit_c_args += '-DNO_PYTHON'
+ build_options_config.set('NO_PYTHON', '1')
+endif
+
+# Perl is used for two different things: our test harness and to provide some
+# features. It is optional if you want to neither execute tests nor use any of
+# these optional features.
+perl_required = get_option('perl')
+if get_option('tests') or get_option('gitweb').enabled()
+ perl_required = true
+endif
+
+# Note that we only set NO_PERL if the Perl features were disabled by the user.
+# It may not be set when we have found Perl, but only use it to run tests.
+perl = find_program('perl', version: '>=5.8.1', dirs: program_path, required: perl_required)
+perl_features_enabled = perl.found() and get_option('perl').allowed()
+if perl_features_enabled
+ build_options_config.set('NO_PERL', '')
+
+ if get_option('runtime_prefix')
+ build_options_config.set('PERL_LOCALEDIR', '')
+ else
+ build_options_config.set_quoted('PERL_LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
+ endif
+
+ if get_option('perl_cpan_fallback')
+ build_options_config.set('NO_PERL_CPAN_FALLBACKS', '')
+ else
+ build_options_config.set_quoted('NO_PERL_CPAN_FALLBACKS', 'YesPlease')
+ endif
+else
+ libgit_c_args += '-DNO_PERL'
+ build_options_config.set('NO_PERL', '1')
+ build_options_config.set('PERL_LOCALEDIR', '')
+ build_options_config.set('NO_PERL_CPAN_FALLBACKS', '')
+endif
+
+zlib = dependency('zlib', default_options: ['default_library=static', 'tests=disabled'])
+if zlib.version().version_compare('<1.2.0')
+ libgit_c_args += '-DNO_DEFLATE_BOUND'
+endif
+libgit_dependencies += zlib
+
+threads = dependency('threads', required: false)
+if threads.found()
+ libgit_dependencies += threads
+ build_options_config.set('NO_PTHREADS', '')
+else
+ libgit_c_args += '-DNO_PTHREADS'
+ build_options_config.set('NO_PTHREADS', '1')
+endif
+
+msgfmt = find_program('msgfmt', dirs: program_path, required: false)
+gettext_option = get_option('gettext').disable_auto_if(not msgfmt.found())
+if not msgfmt.found() and gettext_option.enabled()
+ error('Internationalization via libintl requires msgfmt')
+endif
+
+if gettext_option.allowed() and host_machine.system() == 'darwin' and get_option('macos_use_homebrew_gettext')
+ if host_machine.cpu_family() == 'x86_64'
+ libintl_prefix = '/usr/local'
+ elif host_machine.cpu_family() == 'aarch64'
+ libintl_prefix = '/opt/homebrew'
+ else
+ error('Homebrew workaround not supported on current architecture')
+ endif
+
+ intl = compiler.find_library('intl', dirs: libintl_prefix / 'lib', required: gettext_option)
+ if intl.found()
+ intl = declare_dependency(
+ dependencies: intl,
+ include_directories: libintl_prefix / 'include',
+ )
+ endif
+else
+ intl = dependency('intl', required: gettext_option)
+endif
+if intl.found()
+ libgit_dependencies += intl
+ build_options_config.set('NO_GETTEXT', '')
+ build_options_config.set('USE_GETTEXT_SCHEME', '')
+
+ # POSIX nowadays requires `nl_langinfo()`, but some systems still don't have
+ # the function available. On such systems we instead fall back to libcharset.
+ # On native Windows systems we use our own emulation.
+ if host_machine.system() != 'windows' and not compiler.has_function('nl_langinfo')
+ libcharset = compiler.find_library('charset', required: true)
+ libgit_dependencies += libcharset
+ libgit_c_args += '-DHAVE_LIBCHARSET_H'
+ endif
+else
+ libgit_c_args += '-DNO_GETTEXT'
+ build_options_config.set('NO_GETTEXT', '1')
+ build_options_config.set('USE_GETTEXT_SCHEME', 'fallthrough')
+endif
+
+iconv = dependency('iconv', required: get_option('iconv'))
+if iconv.found()
+ libgit_dependencies += iconv
+ build_options_config.set('NO_ICONV', '')
+
+ have_old_iconv = false
+ if not compiler.compiles('''
+ #include <iconv.h>
+
+ extern size_t iconv(iconv_t cd,
+ char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft);
+ ''', name: 'old iconv interface', dependencies: [iconv])
+ libgit_c_args += '-DOLD_ICONV'
+ have_old_iconv = true
+ endif
+
+ iconv_omits_bom_source = '''#
+ #include <iconv.h>
+
+ int main(int argc, const char **argv)
+ {
+ '''
+ if have_old_iconv
+ iconv_omits_bom_source += '''
+ typedef const char *iconv_ibp;
+ '''
+ else
+ iconv_omits_bom_source += '''
+ typedef char *iconv_ibp;
+ '''
+ endif
+ iconv_omits_bom_source += '''
+ int v;
+ iconv_t conv;
+ char in[] = "a"; iconv_ibp pin = in;
+ char out[20] = ""; char *pout = out;
+ size_t isz = sizeof in;
+ size_t osz = sizeof out;
+
+ conv = iconv_open("UTF-16", "UTF-8");
+ iconv(conv, &pin, &isz, &pout, &osz);
+ iconv_close(conv);
+ v = (unsigned char)(out[0]) + (unsigned char)(out[1]);
+ return v != 0xfe + 0xff;
+ }
+ '''
+
+ if compiler.run(iconv_omits_bom_source,
+ dependencies: iconv,
+ name: 'iconv omits BOM',
+ ).returncode() != 0
+ libgit_c_args += '-DICONV_OMITS_BOM'
+ endif
+else
+ libgit_c_args += '-DNO_ICONV'
+ build_options_config.set('NO_ICONV', '1')
+endif
+
+pcre2 = dependency('libpcre2-8', required: get_option('pcre2'), default_options: ['default_library=static', 'test=false'])
+if pcre2.found()
+ libgit_dependencies += pcre2
+ libgit_c_args += '-DUSE_LIBPCRE2'
+ build_options_config.set('USE_LIBPCRE2', '1')
+else
+ build_options_config.set('USE_LIBPCRE2', '')
+endif
+
+curl = dependency('libcurl', version: '>=7.21.3', required: get_option('curl'), default_options: ['default_library=static', 'tests=disabled', 'tool=disabled'])
+use_curl_for_imap_send = false
+if curl.found()
+ if curl.version().version_compare('>=7.34.0')
+ libgit_c_args += '-DUSE_CURL_FOR_IMAP_SEND'
+ use_curl_for_imap_send = true
+ endif
+
+ libgit_dependencies += curl
+ libgit_c_args += '-DCURL_DISABLE_TYPECHECK'
+ build_options_config.set('NO_CURL', '')
+else
+ libgit_c_args += '-DNO_CURL'
+ build_options_config.set('NO_CURL', '1')
+endif
+
+expat = dependency('expat', required: get_option('expat'), default_options: ['default_library=static', 'build_tests=false'])
+if expat.found()
+ libgit_dependencies += expat
+
+ if expat.version().version_compare('<=1.2')
+ libgit_c_args += '-DEXPAT_NEEDS_XMLPARSE_H'
+ endif
+ build_options_config.set('NO_EXPAT', '')
+else
+ libgit_c_args += '-DNO_EXPAT'
+ build_options_config.set('NO_EXPAT', '1')
+endif
+
+if not compiler.has_header('sys/select.h')
+ libgit_c_args += '-DNO_SYS_SELECT_H'
+endif
+
+has_poll_h = compiler.has_header('poll.h')
+if not has_poll_h
+ libgit_c_args += '-DNO_POLL_H'
+endif
+
+has_sys_poll_h = compiler.has_header('sys/poll.h')
+if not has_sys_poll_h
+ libgit_c_args += '-DNO_SYS_POLL_H'
+endif
+
+if not has_poll_h and not has_sys_poll_h
+ libgit_c_args += '-DNO_POLL'
+ libgit_sources += 'compat/poll/poll.c'
+ libgit_include_directories += 'compat/poll'
+endif
+
+if not compiler.has_header('inttypes.h')
+ libgit_c_args += '-DNO_INTTYPES_H'
+endif
+
+if compiler.has_header('alloca.h')
+ libgit_c_args += '-DHAVE_ALLOCA_H'
+endif
+
+if compiler.has_header('sys/sysinfo.h')
+ libgit_c_args += '-DHAVE_SYSINFO'
+endif
+
+# Windows has libgen.h and a basename implementation, but we still need our own
+# implementation to threat things like drive prefixes specially.
+if host_machine.system() == 'windows' or not compiler.has_header('libgen.h')
+ libgit_c_args += '-DNO_LIBGEN_H'
+ libgit_sources += 'compat/basename.c'
+endif
+
+if compiler.has_header('paths.h')
+ libgit_c_args += '-DHAVE_PATHS_H'
+endif
+
+if compiler.has_header('strings.h')
+ libgit_c_args += '-DHAVE_STRINGS_H'
+endif
+
+networking_dependencies = [ ]
+if host_machine.system() == 'windows'
+ winsock = compiler.find_library('ws2_32', required: false)
+ if winsock.found()
+ networking_dependencies += winsock
+ endif
+else
+ libresolv = compiler.find_library('resolv', required: false)
+ if libresolv.found()
+ networking_dependencies += libresolv
+ endif
+endif
+libgit_dependencies += networking_dependencies
+
+foreach symbol : ['inet_ntop', 'inet_pton', 'strerror']
+ if not compiler.has_function(symbol, dependencies: networking_dependencies)
+ libgit_c_args += '-DNO_' + symbol.to_upper()
+ endif
+endforeach
+
+has_ipv6 = compiler.has_function('getaddrinfo', dependencies: networking_dependencies)
+if not has_ipv6
+ libgit_c_args += '-DNO_IPV6'
+endif
+
+if not compiler.compiles('''
+ #ifdef _WIN32
+ # include <winsock2.h>
+ #else
+ # include <sys/types.h>
+ # include <sys/socket.h>
+ #endif
+
+ void func(void)
+ {
+ struct sockaddr_storage x;
+ }
+''', name: 'struct sockaddr_storage')
+ if has_ipv6
+ libgit_c_args += '-Dsockaddr_storage=sockaddr_in6'
+ else
+ libgit_c_args += '-Dsockaddr_storage=sockaddr_in'
+ endif
+endif
+
+if compiler.has_function('socket', dependencies: networking_dependencies)
+ libgit_sources += [
+ 'unix-socket.c',
+ 'unix-stream-server.c',
+ ]
+ build_options_config.set('NO_UNIX_SOCKETS', '')
+else
+ libgit_c_args += '-DNO_UNIX_SOCKETS'
+ build_options_config.set('NO_UNIX_SOCKETS', '1')
+endif
+
+if not compiler.has_function('pread')
+ libgit_c_args += '-DNO_PREAD'
+ libgit_sources += 'compat/pread.c'
+endif
+
+if host_machine.system() == 'darwin'
+ libgit_sources += 'compat/precompose_utf8.c'
+ libgit_c_args += '-DPRECOMPOSE_UNICODE'
+ libgit_c_args += '-DPROTECT_HFS_DEFAULT'
+endif
+
+# Configure general compatibility wrappers.
+if host_machine.system() == 'cygwin'
+ libgit_sources += [
+ 'compat/win32/path-utils.c',
+ ]
+elif host_machine.system() == 'windows'
+ libgit_sources += [
+ 'compat/mingw.c',
+ 'compat/winansi.c',
+ 'compat/win32/flush.c',
+ 'compat/win32/path-utils.c',
+ 'compat/win32/pthread.c',
+ 'compat/win32/syslog.c',
+ 'compat/win32/dirent.c',
+ 'compat/win32mmap.c',
+ 'compat/nedmalloc/nedmalloc.c',
+ ]
+
+ libgit_c_args += [
+ '-DDETECT_MSYS_TTY',
+ '-DENSURE_MSYSTEM_IS_SET',
+ '-DNATIVE_CRLF',
+ '-DNOGDI',
+ '-DNO_POSIX_GOODIES',
+ '-DWIN32',
+ '-D_CONSOLE',
+ '-D_CONSOLE_DETECT_MSYS_TTY',
+ '-D__USE_MINGW_ANSI_STDIO=0',
+ ]
+
+ libgit_dependencies += compiler.find_library('ntdll')
+ libgit_include_directories += 'compat/win32'
+ if compiler.get_id() == 'msvc'
+ libgit_include_directories += 'compat/vcbuild/include'
+ endif
+endif
+
+if host_machine.system() == 'linux'
+ libgit_sources += 'compat/linux/procinfo.c'
+elif host_machine.system() == 'windows'
+ libgit_sources += 'compat/win32/trace2_win32_process_info.c'
+else
+ libgit_sources += 'compat/stub/procinfo.c'
+endif
+
+if host_machine.system() == 'cygwin' or host_machine.system() == 'windows'
+ libgit_c_args += [
+ '-DUNRELIABLE_FSTAT',
+ '-DMMAP_PREVENTS_DELETE',
+ '-DOBJECT_CREATION_MODE=1',
+ ]
+endif
+
+# Configure the simple-ipc subsystem required fro the fsmonitor.
+if host_machine.system() == 'windows'
+ libgit_sources += [
+ 'compat/simple-ipc/ipc-shared.c',
+ 'compat/simple-ipc/ipc-win32.c',
+ ]
+ libgit_c_args += '-DSUPPORTS_SIMPLE_IPC'
+else
+ libgit_sources += [
+ 'compat/simple-ipc/ipc-shared.c',
+ 'compat/simple-ipc/ipc-unix-socket.c',
+ ]
+ libgit_c_args += '-DSUPPORTS_SIMPLE_IPC'
+endif
+
+fsmonitor_backend = ''
+if host_machine.system() == 'windows'
+ fsmonitor_backend = 'win32'
+elif host_machine.system() == 'darwin'
+ fsmonitor_backend = 'darwin'
+ libgit_dependencies += dependency('CoreServices')
+endif
+if fsmonitor_backend != ''
+ libgit_c_args += '-DHAVE_FSMONITOR_DAEMON_BACKEND'
+ libgit_c_args += '-DHAVE_FSMONITOR_OS_SETTINGS'
+
+ libgit_sources += [
+ 'compat/fsmonitor/fsm-health-' + fsmonitor_backend + '.c',
+ 'compat/fsmonitor/fsm-ipc-' + fsmonitor_backend + '.c',
+ 'compat/fsmonitor/fsm-listen-' + fsmonitor_backend + '.c',
+ 'compat/fsmonitor/fsm-path-utils-' + fsmonitor_backend + '.c',
+ 'compat/fsmonitor/fsm-settings-' + fsmonitor_backend + '.c',
+ ]
+endif
+build_options_config.set_quoted('FSMONITOR_DAEMON_BACKEND', fsmonitor_backend)
+build_options_config.set_quoted('FSMONITOR_OS_SETTINGS', fsmonitor_backend)
+
+if not get_option('b_sanitize').contains('address') and get_option('regex').allowed() and compiler.has_header('regex.h') and compiler.get_define('REG_STARTEND', prefix: '#include <regex.h>') != ''
+ build_options_config.set('NO_REGEX', '')
+
+ if compiler.get_define('REG_ENHANCED', prefix: '#include <regex.h>') != ''
+ libgit_c_args += '-DUSE_ENHANCED_BASIC_REGULAR_EXPRESSIONS'
+ libgit_sources += 'compat/regcomp_enhanced.c'
+ endif
+elif not get_option('regex').enabled()
+ libgit_c_args += [
+ '-DNO_REGEX',
+ '-DGAWK',
+ '-DNO_MBSUPPORT',
+ ]
+ build_options_config.set('NO_REGEX', '1')
+ libgit_sources += 'compat/regex/regex.c'
+ libgit_include_directories += 'compat/regex'
+else
+ error('Native regex support requested but not found')
+endif
+
+# setitimer and friends are provided by compat/mingw.c.
+if host_machine.system() != 'windows'
+ if not compiler.compiles('''
+ #include <sys/time.h>
+ void func(void)
+ {
+ struct itimerval value;
+ }
+ ''', name: 'struct itimerval')
+ libgit_c_args += '-DNO_STRUCT_ITIMERVAL'
+ libgit_c_args += '-DNO_SETITIMER'
+ elif not compiler.has_function('setitimer')
+ libgit_c_args += '-DNO_SETITIMER'
+ endif
+endif
+
+if compiler.has_member('struct stat', 'st_mtimespec.tv_nsec', prefix: '#include <sys/stat.h>')
+ libgit_c_args += '-DUSE_ST_TIMESPEC'
+elif not compiler.has_member('struct stat', 'st_mtim.tv_nsec', prefix: '#include <sys/stat.h>')
+ libgit_c_args += '-DNO_NSEC'
+endif
+
+if not compiler.has_member('struct stat', 'st_blocks', prefix: '#include <sys/stat.h>')
+ libgit_c_args += '-DNO_ST_BLOCKS_IN_STRUCT_STAT'
+endif
+
+if not compiler.has_member('struct dirent', 'd_type', prefix: '#include <dirent.h>')
+ libgit_c_args += '-DNO_D_TYPE_IN_DIRENT'
+endif
+
+if not compiler.has_member('struct passwd', 'pw_gecos', prefix: '#include <pwd.h>')
+ libgit_c_args += '-DNO_GECOS_IN_PWENT'
+endif
+
+if compiler.has_function('sync_file_range')
+ libgit_c_args += '-DHAVE_SYNC_FILE_RANGE'
+endif
+
+if not compiler.has_function('strcasestr')
+ libgit_c_args += '-DNO_STRCASESTR'
+ libgit_sources += 'compat/strcasestr.c'
+endif
+
+if not compiler.has_function('memmem')
+ libgit_c_args += '-DNO_MEMMEM'
+ libgit_sources += 'compat/memmem.c'
+endif
+
+if not compiler.has_function('strlcpy')
+ libgit_c_args += '-DNO_STRLCPY'
+ libgit_sources += 'compat/strlcpy.c'
+endif
+
+if not compiler.has_function('strdup')
+ libgit_c_args += '-DOVERRIDE_STRDUP'
+ libgit_sources += 'compat/strdup.c'
+endif
+
+if not compiler.has_function('strtoumax')
+ libgit_c_args += '-DNO_STRTOUMAX'
+ libgit_sources += [
+ 'compat/strtoumax.c',
+ 'compat/strtoimax.c',
+ ]
+endif
+
+if not compiler.has_function('strtoull')
+ libgit_c_args += '-DNO_STRTOULL'
+endif
+
+if not compiler.has_function('setenv')
+ libgit_c_args += '-DNO_SETENV'
+ libgit_sources += 'compat/setenv.c'
+endif
+
+if not compiler.has_function('qsort')
+ libgit_c_args += '-DINTERNAL_QSORT'
+endif
+libgit_sources += 'compat/qsort_s.c'
+
+# unsetenv is provided by compat/mingw.c.
+if host_machine.system() != 'windows' and not compiler.has_function('unsetenv')
+ libgit_c_args += '-DNO_UNSETENV'
+ libgit_sources += 'compat/unsetenv.c'
+endif
+
+if not compiler.has_function('mkdtemp')
+ libgit_c_args += '-DNO_MKDTEMP'
+ libgit_sources += 'compat/mkdtemp.c'
+endif
+
+if not compiler.has_function('initgroups')
+ libgit_c_args += '-DNO_INITGROUPS'
+endif
+
+if compiler.has_function('getdelim')
+ libgit_c_args += '-DHAVE_GETDELIM'
+endif
+
+if host_machine.system() == 'windows'
+ libgit_c_args += '-DUSE_WIN32_MMAP'
+elif not compiler.has_function('mmap')
+ libgit_c_args += '-DNO_MMAP'
+ libgit_sources += 'compat/mmap.c'
+endif
+
+if compiler.has_function('clock_gettime')
+ libgit_c_args += '-DHAVE_CLOCK_GETTIME'
+endif
+
+if compiler.compiles('''
+ #include <time.h>
+
+ void func(void)
+ {
+ clockid_t id = CLOCK_MONOTONIC;
+ }
+''', name: 'monotonic clock')
+ libgit_c_args += '-DHAVE_CLOCK_MONOTONIC'
+endif
+
+if not compiler.compiles('''
+ #include <inttypes.h>
+
+ void func(void)
+ {
+ uintmax_t x = 0;
+ }
+''', name: 'uintmax_t')
+ libgit_c_args += '-DNO_UINTMAX_T'
+endif
+
+has_bsd_sysctl = false
+if compiler.has_header('sys/sysctl.h')
+ if compiler.compiles('''
+ #include <stddef.h>
+ #include <sys/sysctl.h>
+
+ void func(void)
+ {
+ int val, mib[2] = { 0 };
+ size_t len = sizeof(val);
+ sysctl(mib, 2, &val, &len, NULL, 0);
+ }
+ ''', name: 'BSD sysctl')
+ libgit_c_args += '-DHAVE_BSD_SYSCTL'
+ has_bsd_sysctl = true
+ endif
+endif
+
+if not meson.is_cross_build() and compiler.run('''
+ #include <stdio.h>
+
+ int main(int argc, const char **argv)
+ {
+ FILE *f = fopen(".", "r");
+ return f ? 0 : 1;
+ }
+''', name: 'fread reads directories').returncode() == 0
+ libgit_c_args += '-DFREAD_READS_DIRECTORIES'
+ libgit_sources += 'compat/fopen.c'
+endif
+
+if not meson.is_cross_build() and fs.exists('/dev/tty')
+ libgit_c_args += '-DHAVE_DEV_TTY'
+endif
+
+https_backend = get_option('https_backend')
+sha1_backend = get_option('sha1_backend')
+sha1_unsafe_backend = get_option('sha1_unsafe_backend')
+sha256_backend = get_option('sha256_backend')
+
+security_framework = dependency('Security', required: 'CommonCrypto' in [https_backend, sha1_backend, sha1_unsafe_backend])
+core_foundation_framework = dependency('CoreFoundation', required: security_framework.found())
+if https_backend == 'auto' and security_framework.found()
+ https_backend = 'CommonCrypto'
+endif
+
+openssl_required = 'openssl' in [https_backend, sha1_backend, sha1_unsafe_backend, sha256_backend]
+openssl = dependency('openssl', required: openssl_required, default_options: ['default_library=static'])
+if https_backend == 'auto' and openssl.found()
+ https_backend = 'openssl'
+endif
+
+if https_backend == 'CommonCrypto'
+ libgit_dependencies += security_framework
+ libgit_dependencies += core_foundation_framework
+ libgit_c_args += '-DAPPLE_COMMON_CRYPTO'
+elif https_backend == 'openssl'
+ libgit_dependencies += openssl
+else
+ # We either couldn't find any dependencies with 'auto' or the user requested
+ # 'none'. Both cases are benign.
+endif
+
+if https_backend != 'openssl'
+ libgit_c_args += '-DNO_OPENSSL'
+endif
+
+if sha1_backend == 'sha1dc'
+ libgit_c_args += '-DSHA1_DC'
+ libgit_c_args += '-DSHA1DC_NO_STANDARD_INCLUDES=1'
+ libgit_c_args += '-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0'
+ libgit_c_args += '-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="git-compat-util.h"'
+ libgit_c_args += '-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="git-compat-util.h"'
+
+ libgit_sources += [
+ 'sha1dc_git.c',
+ 'sha1dc/sha1.c',
+ 'sha1dc/ubc_check.c',
+ ]
+endif
+if sha1_backend == 'CommonCrypto' or sha1_unsafe_backend == 'CommonCrypto'
+ if sha1_backend == 'CommonCrypto'
+ libgit_c_args += '-DSHA1_APPLE'
+ endif
+ if sha1_unsafe_backend == 'CommonCrypto'
+ libgit_c_args += '-DSHA1_APPLE_UNSAFE'
+ endif
+
+ libgit_c_args += '-DCOMMON_DIGEST_FOR_OPENSSL'
+ # Apple CommonCrypto requires chunking
+ libgit_c_args += '-DSHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L'
+endif
+if sha1_backend == 'openssl' or sha1_unsafe_backend == 'openssl'
+ if sha1_backend == 'openssl'
+ libgit_c_args += '-DSHA1_OPENSSL'
+ endif
+ if sha1_unsafe_backend == 'openssl'
+ libgit_c_args += '-DSHA1_OPENSSL_UNSAFE'
+ endif
+
+ libgit_dependencies += openssl
+endif
+if sha1_backend == 'block' or sha1_unsafe_backend == 'block'
+ if sha1_backend == 'block'
+ libgit_c_args += '-DSHA1_BLK'
+ endif
+ if sha1_unsafe_backend == 'block'
+ libgit_c_args += '-DSHA1_BLK_UNSAFE'
+ endif
+
+ libgit_sources += 'block-sha1/sha1.c'
+endif
+
+if sha256_backend == 'openssl'
+ libgit_c_args += '-DSHA256_OPENSSL'
+ libgit_dependencies += openssl
+elif sha256_backend == 'nettle'
+ nettle = dependency('nettle')
+ libgit_dependencies += nettle
+ libgit_c_args += '-DSHA256_NETTLE'
+elif sha256_backend == 'gcrypt'
+ gcrypt = dependency('gcrypt')
+ libgit_dependencies += gcrypt
+ libgit_c_args += '-DSHA256_GCRYPT'
+elif sha256_backend == 'block'
+ libgit_c_args += '-DSHA256_BLK'
+ libgit_sources += 'sha256/block/sha256.c'
+else
+ error('Unhandled SHA256 backend ' + sha256_backend)
+endif
+
+if compiler.has_header_symbol('stdlib.h', 'arc4random_buf')
+ libgit_c_args += '-DHAVE_ARC4RANDOM'
+elif compiler.has_header_symbol('bsd/stdlib.h', 'arc4random_buf')
+ libgit_c_args += '-DHAVE_ARC4RANDOM_BSD'
+elif compiler.has_function('getrandom', prefix: '#include <sys/random.h>')
+ libgit_c_args += '-DHAVE_GETRANDOM'
+elif compiler.has_function('getentropy', prefix: '#include <unistd.h>')
+ libgit_c_args += '-DHAVE_GETENTROPY'
+elif compiler.has_function('RtlGenRandom', prefix: '#include <windows.h>\n#include <ntsecapi.h>')
+ libgit_c_args += '-DHAVE_RTLGENRANDOM'
+elif openssl.found()
+ libgit_c_args += '-DHAVE_OPENSSL_CSPRNG'
+endif
+
+if get_option('runtime_prefix')
+ libgit_c_args += '-DRUNTIME_PREFIX'
+ build_options_config.set('RUNTIME_PREFIX', 'true')
+
+ if compiler.has_header('mach-o/dyld.h')
+ libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'
+ endif
+
+ if has_bsd_sysctl and compiler.compiles('''
+ #include <sys/sysctl.h>
+
+ void func(void)
+ {
+ KERN_PROC_PATHNAME; KERN_PROC;
+ }
+ ''', name: 'BSD KERN_PROC_PATHNAME')
+ libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'
+ endif
+
+ if host_machine.system() == 'linux'
+ libgit_c_args += '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe' + '"'
+ elif host_machine.system() == 'openbsd'
+ libgit_c_args += '-DPROCFS_EXECUTABLE_PATH="' + '/proc/curproc/file' + '"'
+ elif host_machine.system() == 'netbsd'
+ libgit_c_args += '-DPROCFS_EXECUTABLE_PATH="' + '/proc/curproc/exe' + '"'
+ endif
+
+ if host_machine.system() == 'windows' and compiler.compiles('''
+ #include <stdlib.h>
+
+ void func(void)
+ {
+ _wpgmptr;
+ }
+ ''', name: 'Win32 _wpgmptr')
+ libgit_c_args += '-DHAVE_WPGMPTR'
+ endif
+else
+ build_options_config.set('RUNTIME_PREFIX', 'false')
+endif
+
+git_version_file = custom_target(
+ command: [
+ shell,
+ meson.current_source_dir() / 'GIT-VERSION-GEN',
+ meson.current_source_dir(),
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ input: meson.current_source_dir() / 'GIT-VERSION-FILE.in',
+ output: 'GIT-VERSION-FILE',
+ env: version_gen_environment,
+ build_always_stale: true,
+)
+
+version_def_h = custom_target(
+ command: [
+ shell,
+ meson.current_source_dir() / 'GIT-VERSION-GEN',
+ meson.current_source_dir(),
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ input: meson.current_source_dir() / 'version-def.h.in',
+ output: 'version-def.h',
+ # Depend on GIT-VERSION-FILE so that we don't always try to rebuild this
+ # target for the same commit.
+ depends: [git_version_file],
+ env: version_gen_environment,
+)
+
+# Build a separate library for "version.c" so that we do not have to rebuild
+# everything when the current Git commit changes.
+libgit_version_library = static_library('git-version',
+ sources: [
+ 'version.c',
+ version_def_h,
+ ],
+ c_args: libgit_c_args + [
+ '-DGIT_VERSION_H="' + version_def_h.full_path() + '"',
+ ],
+ dependencies: libgit_dependencies,
+ include_directories: libgit_include_directories,
+)
+
+libgit_library = static_library('git',
+ sources: libgit_sources,
+ c_args: libgit_c_args,
+ link_with: libgit_version_library,
+ dependencies: libgit_dependencies,
+ include_directories: libgit_include_directories,
+)
+
+libgit = declare_dependency(
+ compile_args: libgit_c_args,
+ link_with: libgit_library,
+ dependencies: libgit_dependencies,
+ include_directories: libgit_include_directories,
+)
+
+common_main_sources = ['common-main.c']
+common_main_link_args = [ ]
+if host_machine.system() == 'windows'
+ git_rc = custom_target(
+ command: [
+ shell,
+ meson.current_source_dir() / 'GIT-VERSION-GEN',
+ meson.current_source_dir(),
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ input: meson.current_source_dir() / 'git.rc.in',
+ output: 'git.rc',
+ depends: [git_version_file],
+ env: version_gen_environment,
+ )
+
+ common_main_sources += import('windows').compile_resources(git_rc,
+ include_directories: [meson.current_source_dir()],
+ )
+ if compiler.get_argument_syntax() == 'gcc'
+ common_main_link_args += [
+ '-municode',
+ '-Wl,-nxcompat',
+ '-Wl,-dynamicbase',
+ '-Wl,-pic-executable,-e,mainCRTStartup',
+ ]
+ elif compiler.get_argument_syntax() == 'msvc'
+ common_main_link_args += [
+ '/ENTRY:wmainCRTStartup',
+ 'invalidcontinue.obj',
+ ]
+ else
+ error('Unsupported compiler ' + compiler.get_id())
+ endif
+endif
+common_main_library = static_library('common-main',
+ sources: common_main_sources,
+ c_args: libgit_c_args,
+ dependencies: libgit_dependencies,
+ include_directories: libgit_include_directories,
+)
+common_main = declare_dependency(
+ link_with: common_main_library,
+ link_args: common_main_link_args,
+)
+
+bin_wrappers = [ ]
+test_dependencies = [ ]
+
+git = executable('git',
+ sources: builtin_sources + 'git.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+bin_wrappers += git
+
+test_dependencies += executable('git-daemon',
+ sources: 'daemon.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+test_dependencies += executable('git-sh-i18n--envsubst',
+ sources: 'sh-i18n--envsubst.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+bin_wrappers += executable('git-shell',
+ sources: 'shell.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+test_dependencies += executable('git-http-backend',
+ sources: 'http-backend.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+bin_wrappers += executable('scalar',
+ sources: 'scalar.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+if get_option('curl').enabled()
+ curl_sources = [
+ 'http.c',
+ 'http-walker.c',
+ ]
+
+ git_remote_http = executable('git-remote-http',
+ sources: curl_sources + 'remote-curl.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+ )
+ test_dependencies += git_remote_http
+
+ test_dependencies += executable('git-http-fetch',
+ sources: curl_sources + 'http-fetch.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+ )
+
+ if expat.found()
+ test_dependencies += executable('git-http-push',
+ sources: curl_sources + 'http-push.c',
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+ )
+ endif
+
+ foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ]
+ test_dependencies += executable(alias,
+ objects: git_remote_http.extract_all_objects(recursive: false),
+ dependencies: [libgit, common_main],
+ )
+
+ install_symlink(alias + executable_suffix,
+ install_dir: get_option('libexecdir') / 'git-core',
+ pointing_to: 'git-remote-http',
+ )
+ endforeach
+endif
+
+imap_send_sources = ['imap-send.c']
+if use_curl_for_imap_send
+ imap_send_sources += curl_sources
+endif
+
+test_dependencies += executable('git-imap-send',
+ sources: imap_send_sources,
+ dependencies: [libgit, common_main],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ]
+ bin_wrappers += executable(alias,
+ objects: git.extract_all_objects(recursive: false),
+ dependencies: [libgit, common_main],
+ )
+
+ install_symlink(alias + executable_suffix,
+ install_dir: get_option('libexecdir') / 'git-core',
+ pointing_to: 'git',
+ )
+endforeach
+
+foreach symlink : [
+ 'git',
+ 'git-receive-pack',
+ 'git-shell',
+ 'git-upload-archive',
+ 'git-upload-pack',
+ 'scalar',
+]
+ if meson.version().version_compare('>=1.3.0')
+ pointing_to = fs.relative_to(get_option('libexecdir') / 'git-core' / symlink, get_option('bindir'))
+ else
+ pointing_to = '../libexec/git-core' / symlink
+ endif
+
+ install_symlink(symlink,
+ install_dir: get_option('bindir'),
+ pointing_to: pointing_to,
+ )
+endforeach
+
+scripts_sh = [
+ 'git-difftool--helper.sh',
+ 'git-filter-branch.sh',
+ 'git-merge-octopus.sh',
+ 'git-merge-one-file.sh',
+ 'git-merge-resolve.sh',
+ 'git-mergetool--lib.sh',
+ 'git-mergetool.sh',
+ 'git-quiltimport.sh',
+ 'git-request-pull.sh',
+ 'git-sh-i18n.sh',
+ 'git-sh-setup.sh',
+ 'git-submodule.sh',
+ 'git-web--browse.sh',
+]
+if perl_features_enabled
+ scripts_sh += 'git-instaweb.sh'
+endif
+
+foreach script : scripts_sh
+ test_dependencies += custom_target(
+ input: script,
+ output: fs.stem(script),
+ command: [
+ shell,
+ meson.project_source_root() / 'generate-script.sh',
+ '@INPUT@',
+ '@OUTPUT@',
+ meson.project_build_root() / 'GIT-BUILD-OPTIONS',
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+ )
+endforeach
+
+if perl_features_enabled
+ scripts_perl = [
+ 'git-archimport.perl',
+ 'git-cvsexportcommit.perl',
+ 'git-cvsimport.perl',
+ 'git-cvsserver.perl',
+ 'git-send-email.perl',
+ 'git-svn.perl',
+ ]
+
+ pathsep = ':'
+ if host_machine.system() == 'windows'
+ pathsep = ';'
+ endif
+
+ perl_header_template = 'perl/header_templates/fixed_prefix.template.pl'
+ if get_option('runtime_prefix')
+ perl_header_template = 'perl/header_templates/runtime_prefix.template.pl'
+ endif
+
+ perl_header = configure_file(
+ input: perl_header_template,
+ output: 'GIT-PERL-HEADER',
+ configuration: {
+ 'GITEXECDIR_REL': get_option('libexecdir') / 'git-core',
+ 'PERLLIBDIR_REL': get_option('datadir') / 'perl5',
+ 'LOCALEDIR_REL': get_option('datadir') / 'locale',
+ 'INSTLIBDIR': get_option('datadir') / 'perl5',
+ 'PATHSEP': pathsep,
+ },
+ )
+
+ generate_perl_command = [
+ shell,
+ meson.project_source_root() / 'generate-perl.sh',
+ meson.project_build_root() / 'GIT-BUILD-OPTIONS',
+ git_version_file.full_path(),
+ perl_header,
+ '@INPUT@',
+ '@OUTPUT@',
+ ]
+
+ foreach script : scripts_perl
+ generated_script = custom_target(
+ input: script,
+ output: fs.stem(script),
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+ depends: [git_version_file],
+ )
+ test_dependencies += generated_script
+
+ if script == 'git-cvsserver.perl'
+ bin_wrappers += generated_script
+
+ if meson.version().version_compare('>=1.3.0')
+ pointing_to = fs.relative_to(get_option('libexecdir') / 'git-core' / fs.stem(script), get_option('bindir'))
+ else
+ pointing_to = '../libexec/git-core' / fs.stem(script)
+ endif
+
+ install_symlink(fs.stem(script),
+ install_dir: get_option('bindir'),
+ pointing_to: pointing_to,
+ )
+ endif
+ endforeach
+
+ subdir('perl')
+endif
+
+if python.found()
+ scripts_python = [
+ 'git-p4.py'
+ ]
+
+ foreach script : scripts_python
+ generated_python = custom_target(
+ input: script,
+ output: fs.stem(script),
+ command: [
+ shell,
+ meson.project_source_root() / 'generate-python.sh',
+ meson.project_build_root() / 'GIT-BUILD-OPTIONS',
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+ )
+ test_dependencies += generated_python
+ endforeach
+endif
+
+mergetools = [
+ 'mergetools/araxis',
+ 'mergetools/bc',
+ 'mergetools/codecompare',
+ 'mergetools/deltawalker',
+ 'mergetools/diffmerge',
+ 'mergetools/diffuse',
+ 'mergetools/ecmerge',
+ 'mergetools/emerge',
+ 'mergetools/examdiff',
+ 'mergetools/guiffy',
+ 'mergetools/gvimdiff',
+ 'mergetools/kdiff3',
+ 'mergetools/kompare',
+ 'mergetools/meld',
+ 'mergetools/nvimdiff',
+ 'mergetools/opendiff',
+ 'mergetools/p4merge',
+ 'mergetools/smerge',
+ 'mergetools/tkdiff',
+ 'mergetools/tortoisemerge',
+ 'mergetools/vimdiff',
+ 'mergetools/vscode',
+ 'mergetools/winmerge',
+ 'mergetools/xxdiff',
+]
+
+foreach mergetool : mergetools
+ install_data(mergetool, install_dir: get_option('libexecdir') / 'git-core' / 'mergetools')
+endforeach
+
+if intl.found()
+ subdir('po')
+endif
+
+# Gitweb requires Perl, so we disable the auto-feature if Perl was not found.
+# We make sure further up that Perl is required in case the gitweb option is
+# enabled.
+gitweb_option = get_option('gitweb').disable_auto_if(not perl.found())
+if gitweb_option.allowed()
+ subdir('gitweb')
+ build_options_config.set('NO_GITWEB', '')
+else
+ build_options_config.set('NO_GITWEB', '1')
+endif
+
+subdir('templates')
+
+# Everything but the bin-wrappers need to come before this target such that we
+# can properly set up test dependencies. The bin-wrappers themselves are set up
+# at configuration time, so these are fine.
+if get_option('tests')
+ subdir('t')
+endif
+
+subdir('bin-wrappers')
+if get_option('docs') != []
+ subdir('Documentation')
+endif
+
+subdir('contrib')
+
+foreach key, value : {
+ 'DIFF': diff.full_path(),
+ 'GIT_TEST_CMP': diff.full_path() + ' -u',
+ 'GIT_TEST_GITPERLLIB': meson.project_build_root() / 'perl',
+ 'GIT_TEST_MERGE_TOOLS_DIR': meson.project_source_root() / 'mergetools',
+ 'GIT_TEST_POPATH': meson.project_source_root() / 'po',
+ 'GIT_TEST_TEMPLATE_DIR': meson.project_build_root() / 'templates',
+ 'GIT_TEST_TEXTDOMAINDIR': meson.project_build_root() / 'po',
+ 'PAGER_ENV': get_option('pager_environment'),
+ 'PERL_PATH': perl.found() ? perl.full_path() : '',
+ 'PYTHON_PATH': python.found () ? python.full_path() : '',
+ 'SHELL_PATH': shell.full_path(),
+ 'TAR': tar.full_path(),
+ 'TEST_OUTPUT_DIRECTORY': test_output_directory,
+ 'TEST_SHELL_PATH': shell.full_path(),
+}
+ if value != '' and cygpath.found()
+ value = run_command(cygpath, value, check: true).stdout().strip()
+ endif
+ build_options_config.set_quoted(key, value)
+endforeach
+
+configure_file(
+ input: 'GIT-BUILD-OPTIONS.in',
+ output: 'GIT-BUILD-OPTIONS',
+ configuration: build_options_config,
+)
+
+summary({
+ 'curl': curl.found(),
+ 'expat': expat.found(),
+ 'gettext': intl.found(),
+ 'gitweb': gitweb_option.allowed(),
+ 'https': https_backend,
+ 'iconv': iconv.found(),
+ 'pcre2': pcre2.found(),
+ 'perl': perl_features_enabled,
+ 'python': python.found(),
+}, section: 'Auto-detected features')
+
+summary({
+ 'https': https_backend,
+ 'sha1': sha1_backend,
+ 'sha1_unsafe': sha1_unsafe_backend,
+ 'sha256': sha256_backend,
+}, section: 'Backends')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000000..c0d72d85a3
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,99 @@
+# Configuration for how Git behaves at runtime.
+option('default_pager', type: 'string', value: 'less',
+ description: 'Fall-back pager.')
+option('default_editor', type: 'string', value: 'vi',
+ description: 'Fall-back editor.')
+option('gitconfig', type: 'string', value: '/etc/gitconfig',
+ description: 'Path to the global git configuration file.')
+option('gitattributes', type: 'string', value: '/etc/gitattributes',
+ description: 'Path to the global git attributes file.')
+option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',
+ description: 'Environment used when spawning the pager')
+option('perl_cpan_fallback', type: 'boolean', value: true,
+ description: 'Install bundled copies of CPAN modules that serve as a fallback in case the modules are not available on the system.')
+option('runtime_prefix', type: 'boolean', value: false,
+ description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.')
+option('sane_tool_path', type: 'string', value: '',
+ description: 'A colon-separated list of paths to prepend to PATH if your tools in /usr/bin are broken.')
+
+# Build information compiled into Git and other parts like documentation.
+option('build_date', type: 'string', value: '',
+ description: 'Build date reported by our documentation.')
+option('built_from_commit', type: 'string', value: '',
+ description: 'Commit that Git was built from reported by git-version(1).')
+option('user_agent', type: 'string', value: '',
+ description: 'User agent reported to remote servers.')
+option('version', type: 'string', value: '',
+ description: 'Version string reported by git-version(1) and other tools.')
+
+# Features supported by Git.
+option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
+ description: 'Contributed features to include.')
+option('curl', type: 'feature', value: 'enabled',
+ description: 'Build helpers used to access remotes with the HTTP transport.')
+option('expat', type: 'feature', value: 'enabled',
+ description: 'Build helpers used to push to remotes with the HTTP transport.')
+option('gettext', type: 'feature', value: 'auto',
+ description: 'Build translation files.')
+option('gitweb', type: 'feature', value: 'auto',
+ description: 'Build Git web interface. Requires Perl.')
+option('iconv', type: 'feature', value: 'auto',
+ description: 'Support reencoding strings with different encodings.')
+option('pcre2', type: 'feature', value: 'enabled',
+ description: 'Support Perl-compatible regular expressions in e.g. git-grep(1).')
+option('perl', type: 'feature', value: 'auto',
+ description: 'Build tools written in Perl.')
+option('python', type: 'feature', value: 'auto',
+ description: 'Build tools written in Python.')
+option('regex', type: 'feature', value: 'auto',
+ description: 'Use the system-provided regex library instead of the bundled one.')
+
+# Backends.
+option('https_backend', type: 'combo', value: 'auto', choices: ['auto', 'openssl', 'CommonCrypto', 'none'],
+ description: 'The HTTPS backend to use when connecting to remotes.')
+option('sha1_backend', type: 'combo', choices: ['openssl', 'block', 'sha1dc', 'CommonCrypto'], value: 'sha1dc',
+ description: 'The backend used for hashing objects with the SHA1 object format.')
+option('sha1_unsafe_backend', type: 'combo', choices: ['openssl', 'block', 'CommonCrypto', 'none'], value: 'none',
+ description: 'The backend used for hashing data with the SHA1 object format in case no cryptographic security is needed.')
+option('sha256_backend', type: 'combo', choices: ['openssl', 'nettle', 'gcrypt', 'block'], value: 'block',
+ description: 'The backend used for hashing objects with the SHA256 object format.')
+
+# Build tweaks.
+option('macos_use_homebrew_gettext', type: 'boolean', value: true,
+ description: 'Use gettext from Homebrew instead of the slightly-broken system-provided one.')
+
+# gitweb configuration.
+option('gitweb_config', type: 'string', value: 'gitweb_config.perl')
+option('gitweb_config_system', type: 'string', value: '/etc/gitweb.conf')
+option('gitweb_config_common', type: 'string', value: '/etc/gitweb-common.conf')
+option('gitweb_home_link_str', type: 'string', value: 'projects')
+option('gitweb_sitename', type: 'string', value: '')
+option('gitweb_projectroot', type: 'string', value: '/pub/git')
+option('gitweb_project_maxdepth', type: 'string', value: '2007')
+option('gitweb_export_ok', type: 'string', value: '')
+option('gitweb_strict_export', type: 'string', value: '')
+option('gitweb_base_url', type: 'string', value: '')
+option('gitweb_list', type: 'string', value: '')
+option('gitweb_hometext', type: 'string', value: 'indextext.html')
+option('gitweb_css', type: 'string', value: 'static/gitweb.css')
+option('gitweb_logo', type: 'string', value: 'static/git-logo.png')
+option('gitweb_favicon', type: 'string', value: 'static/git-favicon.png')
+option('gitweb_js', type: 'string', value: 'static/gitweb.js')
+option('gitweb_site_html_head_string', type: 'string', value: '')
+option('gitweb_site_header', type: 'string', value: '')
+option('gitweb_site_footer', type: 'string', value: '')
+option('highlight_bin', type: 'string', value: 'highlight')
+
+# Documentation.
+option('docs', type: 'array', choices: ['man', 'html'], value: [],
+ description: 'Which documenattion formats to build and install.')
+option('default_help_format', type: 'combo', choices: ['man', 'html'], value: 'man',
+ description: 'Default format used when executing git-help(1).')
+option('docs_backend', type: 'combo', choices: ['asciidoc', 'asciidoctor', 'auto'], value: 'auto',
+ description: 'Which backend to use to generate documentation.')
+
+# Testing.
+option('tests', type: 'boolean', value: true,
+ description: 'Enable building tests. This requires Perl, but is separate from the "perl" option such that you can build tests without Perl features enabled.')
+option('test_output_directory', type: 'string',
+ description: 'Path to the directory used to store test outputs')
diff --git a/midx-write.c b/midx-write.c
index b3a5f6c516..b3827b936b 100644
--- a/midx-write.c
+++ b/midx-write.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -35,13 +35,13 @@ extern void clear_incremental_midx_files_ext(const char *object_dir,
extern int cmp_idx_or_pack_name(const char *idx_or_pack_name,
const char *idx_name);
-static size_t write_midx_header(struct hashfile *f,
- unsigned char num_chunks,
+static size_t write_midx_header(const struct git_hash_algo *hash_algo,
+ struct hashfile *f, unsigned char num_chunks,
uint32_t num_packs)
{
hashwrite_be32(f, MIDX_SIGNATURE);
hashwrite_u8(f, MIDX_VERSION);
- hashwrite_u8(f, oid_version(the_hash_algo));
+ hashwrite_u8(f, oid_version(hash_algo));
hashwrite_u8(f, num_chunks);
hashwrite_u8(f, 0); /* unused */
hashwrite_be32(f, num_packs);
@@ -110,6 +110,8 @@ struct write_midx_context {
uint32_t num_multi_pack_indexes_before;
struct string_list *to_include;
+
+ struct repository *repo;
};
static int should_include_pack(const struct write_midx_context *ctx,
@@ -154,7 +156,7 @@ static void add_pack_to_midx(const char *full_path, size_t full_path_len,
return;
ALLOC_GROW(ctx->info, ctx->nr + 1, ctx->alloc);
- p = add_packed_git(full_path, full_path_len, 0);
+ p = add_packed_git(ctx->repo, full_path, full_path_len, 0);
if (!p) {
warning(_("failed to add packfile '%s'"),
full_path);
@@ -480,7 +482,7 @@ static int write_midx_oid_lookup(struct hashfile *f,
void *data)
{
struct write_midx_context *ctx = data;
- unsigned char hash_len = the_hash_algo->rawsz;
+ unsigned char hash_len = ctx->repo->hash_algo->rawsz;
struct pack_midx_entry *list = ctx->entries;
uint32_t i;
@@ -605,7 +607,7 @@ static uint32_t *midx_pack_order(struct write_midx_context *ctx)
uint32_t *pack_order, base_objects = 0;
uint32_t i;
- trace2_region_enter("midx", "midx_pack_order", the_repository);
+ trace2_region_enter("midx", "midx_pack_order", ctx->repo);
if (ctx->incremental && ctx->base_midx)
base_objects = ctx->base_midx->num_objects +
@@ -640,7 +642,7 @@ static uint32_t *midx_pack_order(struct write_midx_context *ctx)
}
free(data);
- trace2_region_leave("midx", "midx_pack_order", the_repository);
+ trace2_region_leave("midx", "midx_pack_order", ctx->repo);
return pack_order;
}
@@ -651,9 +653,10 @@ static void write_midx_reverse_index(char *midx_name, unsigned char *midx_hash,
struct strbuf buf = STRBUF_INIT;
char *tmp_file;
- trace2_region_enter("midx", "write_midx_reverse_index", the_repository);
+ trace2_region_enter("midx", "write_midx_reverse_index", ctx->repo);
- strbuf_addf(&buf, "%s-%s.rev", midx_name, hash_to_hex(midx_hash));
+ strbuf_addf(&buf, "%s-%s.rev", midx_name, hash_to_hex_algop(midx_hash,
+ ctx->repo->hash_algo));
tmp_file = write_rev_file_order(NULL, ctx->pack_order, ctx->entries_nr,
midx_hash, WRITE_REV);
@@ -664,7 +667,7 @@ static void write_midx_reverse_index(char *midx_name, unsigned char *midx_hash,
strbuf_release(&buf);
free(tmp_file);
- trace2_region_leave("midx", "write_midx_reverse_index", the_repository);
+ trace2_region_leave("midx", "write_midx_reverse_index", ctx->repo);
}
static void prepare_midx_packing_data(struct packing_data *pdata,
@@ -672,10 +675,10 @@ static void prepare_midx_packing_data(struct packing_data *pdata,
{
uint32_t i;
- trace2_region_enter("midx", "prepare_midx_packing_data", the_repository);
+ trace2_region_enter("midx", "prepare_midx_packing_data", ctx->repo);
memset(pdata, 0, sizeof(struct packing_data));
- prepare_packing_data(the_repository, pdata);
+ prepare_packing_data(ctx->repo, pdata);
for (i = 0; i < ctx->entries_nr; i++) {
uint32_t pos = ctx->pack_order[i];
@@ -686,7 +689,7 @@ static void prepare_midx_packing_data(struct packing_data *pdata,
ctx->info[ctx->pack_perm[from->pack_int_id]].p);
}
- trace2_region_leave("midx", "prepare_midx_packing_data", the_repository);
+ trace2_region_leave("midx", "prepare_midx_packing_data", ctx->repo);
}
static int add_ref_to_pending(const char *refname, const char *referent UNUSED,
@@ -702,7 +705,7 @@ static int add_ref_to_pending(const char *refname, const char *referent UNUSED,
return 0;
}
- if (!peel_iterated_oid(the_repository, oid, &peeled))
+ if (!peel_iterated_oid(revs->repo, oid, &peeled))
oid = &peeled;
object = parse_object_or_die(oid, refname);
@@ -760,7 +763,7 @@ static int read_refs_snapshot(const char *refs_snapshot,
hex = &buf.buf[1];
}
- if (parse_oid_hex(hex, &oid, &end) < 0)
+ if (parse_oid_hex_algop(hex, &oid, &end, revs->repo->hash_algo) < 0)
die(_("could not parse line: %s"), buf.buf);
if (*end)
die(_("malformed line: %s"), buf.buf);
@@ -776,6 +779,7 @@ static int read_refs_snapshot(const char *refs_snapshot,
strbuf_release(&buf);
return 0;
}
+
static struct commit **find_commits_for_midx_bitmap(uint32_t *indexed_commits_nr_p,
const char *refs_snapshot,
struct write_midx_context *ctx)
@@ -783,17 +787,16 @@ static struct commit **find_commits_for_midx_bitmap(uint32_t *indexed_commits_nr
struct rev_info revs;
struct bitmap_commit_cb cb = {0};
- trace2_region_enter("midx", "find_commits_for_midx_bitmap",
- the_repository);
+ trace2_region_enter("midx", "find_commits_for_midx_bitmap", ctx->repo);
cb.ctx = ctx;
- repo_init_revisions(the_repository, &revs, NULL);
+ repo_init_revisions(ctx->repo, &revs, NULL);
if (refs_snapshot) {
read_refs_snapshot(refs_snapshot, &revs);
} else {
setup_revisions(0, NULL, &revs, NULL);
- refs_for_each_ref(get_main_ref_store(the_repository),
+ refs_for_each_ref(get_main_ref_store(ctx->repo),
add_ref_to_pending, &revs);
}
@@ -821,13 +824,12 @@ static struct commit **find_commits_for_midx_bitmap(uint32_t *indexed_commits_nr
release_revisions(&revs);
- trace2_region_leave("midx", "find_commits_for_midx_bitmap",
- the_repository);
+ trace2_region_leave("midx", "find_commits_for_midx_bitmap", ctx->repo);
return cb.commits;
}
-static int write_midx_bitmap(const char *midx_name,
+static int write_midx_bitmap(struct repository *r, const char *midx_name,
const unsigned char *midx_hash,
struct packing_data *pdata,
struct commit **commits,
@@ -840,9 +842,9 @@ static int write_midx_bitmap(const char *midx_name,
struct bitmap_writer writer;
struct pack_idx_entry **index;
char *bitmap_name = xstrfmt("%s-%s.bitmap", midx_name,
- hash_to_hex(midx_hash));
+ hash_to_hex_algop(midx_hash, r->hash_algo));
- trace2_region_enter("midx", "write_midx_bitmap", the_repository);
+ trace2_region_enter("midx", "write_midx_bitmap", r);
if (flags & MIDX_WRITE_BITMAP_HASH_CACHE)
options |= BITMAP_OPT_HASH_CACHE;
@@ -859,7 +861,7 @@ static int write_midx_bitmap(const char *midx_name,
for (i = 0; i < pdata->nr_objects; i++)
index[i] = &pdata->objects[i].idx;
- bitmap_writer_init(&writer, the_repository, pdata);
+ bitmap_writer_init(&writer, r, pdata);
bitmap_writer_show_progress(&writer, flags & MIDX_PROGRESS);
bitmap_writer_build_type_index(&writer, index);
@@ -892,7 +894,7 @@ cleanup:
free(bitmap_name);
bitmap_writer_free(&writer);
- trace2_region_leave("midx", "write_midx_bitmap", the_repository);
+ trace2_region_leave("midx", "write_midx_bitmap", r);
return ret;
}
@@ -944,7 +946,7 @@ static int fill_packs_from_midx(struct write_midx_context *ctx,
*/
if (flags & MIDX_WRITE_REV_INDEX ||
preferred_pack_name) {
- if (prepare_midx_pack(the_repository, m,
+ if (prepare_midx_pack(ctx->repo, m,
m->num_packs_in_base + i)) {
error(_("could not load pack"));
return 1;
@@ -991,9 +993,10 @@ static int link_midx_to_chain(struct multi_pack_index *m)
for (i = 0; i < ARRAY_SIZE(midx_exts); i++) {
const unsigned char *hash = get_midx_checksum(m);
- get_midx_filename_ext(&from, m->object_dir, hash,
- midx_exts[i].non_split);
- get_split_midx_filename_ext(&to, m->object_dir, hash,
+ get_midx_filename_ext(m->repo->hash_algo, &from, m->object_dir,
+ hash, midx_exts[i].non_split);
+ get_split_midx_filename_ext(m->repo->hash_algo, &to,
+ m->object_dir, hash,
midx_exts[i].split);
if (link(from.buf, to.buf) < 0 && errno != ENOENT) {
@@ -1012,9 +1015,8 @@ done:
return ret;
}
-static void clear_midx_files(const char *object_dir,
- const char **hashes,
- uint32_t hashes_nr,
+static void clear_midx_files(struct repository *r, const char *object_dir,
+ const char **hashes, uint32_t hashes_nr,
unsigned incremental)
{
/*
@@ -1039,7 +1041,7 @@ static void clear_midx_files(const char *object_dir,
}
if (incremental)
- get_midx_filename(&buf, object_dir);
+ get_midx_filename(r->hash_algo, &buf, object_dir);
else
get_midx_chain_filename(&buf, object_dir);
@@ -1049,7 +1051,7 @@ static void clear_midx_files(const char *object_dir,
strbuf_release(&buf);
}
-static int write_midx_internal(const char *object_dir,
+static int write_midx_internal(struct repository *r, const char *object_dir,
struct string_list *packs_to_include,
struct string_list *packs_to_drop,
const char *preferred_pack_name,
@@ -1070,7 +1072,9 @@ static int write_midx_internal(const char *object_dir,
const char **keep_hashes = NULL;
struct chunkfile *cf;
- trace2_region_enter("midx", "write_midx_internal", the_repository);
+ trace2_region_enter("midx", "write_midx_internal", r);
+
+ ctx.repo = r;
ctx.incremental = !!(flags & MIDX_WRITE_INCREMENTAL);
if (ctx.incremental && (flags & MIDX_WRITE_BITMAP))
@@ -1081,14 +1085,13 @@ static int write_midx_internal(const char *object_dir,
"%s/pack/multi-pack-index.d/tmp_midx_XXXXXX",
object_dir);
else
- get_midx_filename(&midx_name, object_dir);
+ get_midx_filename(r->hash_algo, &midx_name, object_dir);
if (safe_create_leading_directories(midx_name.buf))
die_errno(_("unable to create leading directories of %s"),
midx_name.buf);
if (!packs_to_include || ctx.incremental) {
- struct multi_pack_index *m = lookup_multi_pack_index(the_repository,
- object_dir);
+ struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
if (m && !midx_checksum_valid(m)) {
warning(_("ignoring existing multi-pack-index; checksum mismatch"));
m = NULL;
@@ -1128,7 +1131,8 @@ static int write_midx_internal(const char *object_dir,
ctx.pack_paths_checked = 0;
if (flags & MIDX_PROGRESS)
- ctx.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0);
+ ctx.progress = start_delayed_progress(r,
+ _("Adding packfiles to multi-pack-index"), 0);
else
ctx.progress = NULL;
@@ -1351,7 +1355,7 @@ 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,
- st_mult(ctx.entries_nr, the_hash_algo->rawsz),
+ st_mult(ctx.entries_nr, r->hash_algo->rawsz),
write_midx_oid_lookup);
add_chunk(cf, MIDX_CHUNKID_OBJECTOFFSETS,
st_mult(ctx.entries_nr, MIDX_CHUNK_OFFSET_WIDTH),
@@ -1373,7 +1377,8 @@ static int write_midx_internal(const char *object_dir,
write_midx_bitmapped_packs);
}
- write_midx_header(f, get_num_chunks(cf), ctx.nr - dropped_packs);
+ write_midx_header(r->hash_algo, f, get_num_chunks(cf),
+ ctx.nr - dropped_packs);
write_chunkfile(cf, &ctx);
finalize_hashfile(f, midx_hash, FSYNC_COMPONENT_PACK_METADATA,
@@ -1405,7 +1410,7 @@ static int write_midx_internal(const char *object_dir,
FREE_AND_NULL(ctx.entries);
ctx.entries_nr = 0;
- if (write_midx_bitmap(midx_name.buf, midx_hash, &pdata,
+ if (write_midx_bitmap(r, midx_name.buf, midx_hash, &pdata,
commits, commits_nr, ctx.pack_order,
flags) < 0) {
error(_("could not write multi-pack bitmap"));
@@ -1438,8 +1443,8 @@ static int write_midx_internal(const char *object_dir,
if (link_midx_to_chain(ctx.base_midx) < 0)
return -1;
- get_split_midx_filename_ext(&final_midx_name, object_dir,
- midx_hash, MIDX_EXT_MIDX);
+ get_split_midx_filename_ext(r->hash_algo, &final_midx_name,
+ object_dir, midx_hash, MIDX_EXT_MIDX);
if (rename_tempfile(&incr, final_midx_name.buf) < 0) {
error_errno(_("unable to rename new multi-pack-index layer"));
@@ -1449,12 +1454,13 @@ static int write_midx_internal(const char *object_dir,
strbuf_release(&final_midx_name);
keep_hashes[ctx.num_multi_pack_indexes_before] =
- xstrdup(hash_to_hex(midx_hash));
+ xstrdup(hash_to_hex_algop(midx_hash, r->hash_algo));
for (i = 0; i < ctx.num_multi_pack_indexes_before; i++) {
uint32_t j = ctx.num_multi_pack_indexes_before - i - 1;
- keep_hashes[j] = xstrdup(hash_to_hex(get_midx_checksum(m)));
+ keep_hashes[j] = xstrdup(hash_to_hex_algop(get_midx_checksum(m),
+ r->hash_algo));
m = m->base_midx;
}
@@ -1462,16 +1468,16 @@ static int write_midx_internal(const char *object_dir,
fprintf(get_lock_file_fp(&lk), "%s\n", keep_hashes[i]);
} else {
keep_hashes[ctx.num_multi_pack_indexes_before] =
- xstrdup(hash_to_hex(midx_hash));
+ xstrdup(hash_to_hex_algop(midx_hash, r->hash_algo));
}
if (ctx.m || ctx.base_midx)
- close_object_store(the_repository->objects);
+ close_object_store(ctx.repo->objects);
if (commit_lock_file(&lk) < 0)
die_errno(_("could not write multi-pack-index"));
- clear_midx_files(object_dir, keep_hashes,
+ clear_midx_files(r, object_dir, keep_hashes,
ctx.num_multi_pack_indexes_before + 1,
ctx.incremental);
@@ -1495,27 +1501,26 @@ cleanup:
}
strbuf_release(&midx_name);
- trace2_region_leave("midx", "write_midx_internal", the_repository);
+ trace2_region_leave("midx", "write_midx_internal", r);
return result;
}
-int write_midx_file(const char *object_dir,
+int write_midx_file(struct repository *r, const char *object_dir,
const char *preferred_pack_name,
- const char *refs_snapshot,
- unsigned flags)
+ const char *refs_snapshot, unsigned flags)
{
- return write_midx_internal(object_dir, NULL, NULL, preferred_pack_name,
- refs_snapshot, flags);
+ return write_midx_internal(r, object_dir, NULL, NULL,
+ preferred_pack_name, refs_snapshot,
+ flags);
}
-int write_midx_file_only(const char *object_dir,
+int write_midx_file_only(struct repository *r, const char *object_dir,
struct string_list *packs_to_include,
const char *preferred_pack_name,
- const char *refs_snapshot,
- unsigned flags)
+ const char *refs_snapshot, unsigned flags)
{
- return write_midx_internal(object_dir, packs_to_include, NULL,
+ return write_midx_internal(r, object_dir, packs_to_include, NULL,
preferred_pack_name, refs_snapshot, flags);
}
@@ -1535,7 +1540,9 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
CALLOC_ARRAY(count, m->num_packs);
if (flags & MIDX_PROGRESS)
- progress = start_delayed_progress(_("Counting referenced objects"),
+ progress = start_delayed_progress(
+ r,
+ _("Counting referenced objects"),
m->num_objects);
for (i = 0; i < m->num_objects; i++) {
int pack_int_id = nth_midxed_pack_int_id(m, i);
@@ -1545,7 +1552,9 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
stop_progress(&progress);
if (flags & MIDX_PROGRESS)
- progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"),
+ progress = start_delayed_progress(
+ r,
+ _("Finding and deleting unreferenced packfiles"),
m->num_packs);
for (i = 0; i < m->num_packs; i++) {
char *pack_name;
@@ -1572,7 +1581,8 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
free(count);
if (packs_to_drop.nr)
- result = write_midx_internal(object_dir, NULL, &packs_to_drop, NULL, NULL, flags);
+ result = write_midx_internal(r, object_dir, NULL,
+ &packs_to_drop, NULL, NULL, flags);
string_list_clear(&packs_to_drop, 0);
@@ -1769,7 +1779,8 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
goto cleanup;
}
- result = write_midx_internal(object_dir, NULL, NULL, NULL, NULL, flags);
+ result = write_midx_internal(r, object_dir, NULL, NULL, NULL, NULL,
+ flags);
cleanup:
free(include_pack);
diff --git a/midx.c b/midx.c
index e82d4f2e65..d91088efb8 100644
--- a/midx.c
+++ b/midx.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -25,20 +25,22 @@ int cmp_idx_or_pack_name(const char *idx_or_pack_name,
const unsigned char *get_midx_checksum(struct multi_pack_index *m)
{
- return m->data + m->data_len - the_hash_algo->rawsz;
+ return m->data + m->data_len - m->repo->hash_algo->rawsz;
}
-void get_midx_filename(struct strbuf *out, const char *object_dir)
+void get_midx_filename(const struct git_hash_algo *hash_algo,
+ struct strbuf *out, const char *object_dir)
{
- get_midx_filename_ext(out, object_dir, NULL, NULL);
+ get_midx_filename_ext(hash_algo, out, object_dir, NULL, NULL);
}
-void get_midx_filename_ext(struct strbuf *out, const char *object_dir,
+void get_midx_filename_ext(const struct git_hash_algo *hash_algo,
+ struct strbuf *out, const char *object_dir,
const unsigned char *hash, const char *ext)
{
strbuf_addf(out, "%s/pack/multi-pack-index", object_dir);
if (ext)
- strbuf_addf(out, "-%s.%s", hash_to_hex(hash), ext);
+ strbuf_addf(out, "-%s.%s", hash_to_hex_algop(hash, hash_algo), ext);
}
static int midx_read_oid_fanout(const unsigned char *chunk_start,
@@ -92,9 +94,8 @@ static int midx_read_object_offsets(const unsigned char *chunk_start,
return 0;
}
-#define MIDX_MIN_SIZE (MIDX_HEADER_SIZE + the_hash_algo->rawsz)
-
-static struct multi_pack_index *load_multi_pack_index_one(const char *object_dir,
+static struct multi_pack_index *load_multi_pack_index_one(struct repository *r,
+ const char *object_dir,
const char *midx_name,
int local)
{
@@ -119,7 +120,7 @@ static struct multi_pack_index *load_multi_pack_index_one(const char *object_dir
midx_size = xsize_t(st.st_size);
- if (midx_size < MIDX_MIN_SIZE) {
+ if (midx_size < (MIDX_HEADER_SIZE + r->hash_algo->rawsz)) {
error(_("multi-pack-index file %s is too small"), midx_name);
goto cleanup_fail;
}
@@ -131,6 +132,7 @@ static struct multi_pack_index *load_multi_pack_index_one(const char *object_dir
m->data = midx_map;
m->data_len = midx_size;
m->local = local;
+ m->repo = r;
m->signature = get_be32(m->data);
if (m->signature != MIDX_SIGNATURE)
@@ -143,12 +145,12 @@ static struct multi_pack_index *load_multi_pack_index_one(const char *object_dir
m->version);
hash_version = m->data[MIDX_BYTE_HASH_VERSION];
- if (hash_version != oid_version(the_hash_algo)) {
+ if (hash_version != oid_version(r->hash_algo)) {
error(_("multi-pack-index hash version %u does not match version %u"),
- hash_version, oid_version(the_hash_algo));
+ hash_version, oid_version(r->hash_algo));
goto cleanup_fail;
}
- m->hash_len = the_hash_algo->rawsz;
+ m->hash_len = r->hash_algo->rawsz;
m->num_chunks = m->data[MIDX_BYTE_NUM_CHUNKS];
@@ -205,8 +207,8 @@ static struct multi_pack_index *load_multi_pack_index_one(const char *object_dir
m->pack_names[i]);
}
- trace2_data_intmax("midx", the_repository, "load/num_packs", m->num_packs);
- trace2_data_intmax("midx", the_repository, "load/num_objects", m->num_objects);
+ trace2_data_intmax("midx", r, "load/num_packs", m->num_packs);
+ trace2_data_intmax("midx", r, "load/num_objects", m->num_objects);
free_chunkfile(cf);
return m;
@@ -232,15 +234,18 @@ void get_midx_chain_filename(struct strbuf *buf, const char *object_dir)
strbuf_addstr(buf, "/multi-pack-index-chain");
}
-void get_split_midx_filename_ext(struct strbuf *buf, const char *object_dir,
+void get_split_midx_filename_ext(const struct git_hash_algo *hash_algo,
+ struct strbuf *buf, const char *object_dir,
const unsigned char *hash, const char *ext)
{
get_midx_chain_dirname(buf, object_dir);
- strbuf_addf(buf, "/multi-pack-index-%s.%s", hash_to_hex(hash), ext);
+ strbuf_addf(buf, "/multi-pack-index-%s.%s",
+ hash_to_hex_algop(hash, hash_algo), ext);
}
-static int open_multi_pack_index_chain(const char *chain_file,
- int *fd, struct stat *st)
+static int open_multi_pack_index_chain(const struct git_hash_algo *hash_algo,
+ const char *chain_file, int *fd,
+ struct stat *st)
{
*fd = git_open(chain_file);
if (*fd < 0)
@@ -249,7 +254,7 @@ static int open_multi_pack_index_chain(const char *chain_file,
close(*fd);
return 0;
}
- if (st->st_size < the_hash_algo->hexsz) {
+ if (st->st_size < hash_algo->hexsz) {
close(*fd);
if (!st->st_size) {
/* treat empty files the same as missing */
@@ -291,7 +296,8 @@ static int add_midx_to_chain(struct multi_pack_index *midx,
return 1;
}
-static struct multi_pack_index *load_midx_chain_fd_st(const char *object_dir,
+static struct multi_pack_index *load_midx_chain_fd_st(struct repository *r,
+ const char *object_dir,
int local,
int fd, struct stat *st,
int *incomplete_chain)
@@ -302,7 +308,7 @@ static struct multi_pack_index *load_midx_chain_fd_st(const char *object_dir,
uint32_t i, count;
FILE *fp = xfdopen(fd, "r");
- count = st->st_size / (the_hash_algo->hexsz + 1);
+ count = st->st_size / (r->hash_algo->hexsz + 1);
for (i = 0; i < count; i++) {
struct multi_pack_index *m;
@@ -311,7 +317,7 @@ static struct multi_pack_index *load_midx_chain_fd_st(const char *object_dir,
if (strbuf_getline_lf(&buf, fp) == EOF)
break;
- if (get_oid_hex(buf.buf, &layer)) {
+ if (get_oid_hex_algop(buf.buf, &layer, r->hash_algo)) {
warning(_("invalid multi-pack-index chain: line '%s' "
"not a hash"),
buf.buf);
@@ -322,9 +328,9 @@ static struct multi_pack_index *load_midx_chain_fd_st(const char *object_dir,
valid = 0;
strbuf_reset(&buf);
- get_split_midx_filename_ext(&buf, object_dir, layer.hash,
- MIDX_EXT_MIDX);
- m = load_multi_pack_index_one(object_dir, buf.buf, local);
+ get_split_midx_filename_ext(r->hash_algo, &buf, object_dir,
+ layer.hash, MIDX_EXT_MIDX);
+ m = load_multi_pack_index_one(r, object_dir, buf.buf, local);
if (m) {
if (add_midx_to_chain(m, midx_chain)) {
@@ -347,7 +353,8 @@ static struct multi_pack_index *load_midx_chain_fd_st(const char *object_dir,
return midx_chain;
}
-static struct multi_pack_index *load_multi_pack_index_chain(const char *object_dir,
+static struct multi_pack_index *load_multi_pack_index_chain(struct repository *r,
+ const char *object_dir,
int local)
{
struct strbuf chain_file = STRBUF_INIT;
@@ -356,10 +363,10 @@ static struct multi_pack_index *load_multi_pack_index_chain(const char *object_d
struct multi_pack_index *m = NULL;
get_midx_chain_filename(&chain_file, object_dir);
- if (open_multi_pack_index_chain(chain_file.buf, &fd, &st)) {
+ if (open_multi_pack_index_chain(r->hash_algo, chain_file.buf, &fd, &st)) {
int incomplete;
/* ownership of fd is taken over by load function */
- m = load_midx_chain_fd_st(object_dir, local, fd, &st,
+ m = load_midx_chain_fd_st(r, object_dir, local, fd, &st,
&incomplete);
}
@@ -367,17 +374,19 @@ static struct multi_pack_index *load_multi_pack_index_chain(const char *object_d
return m;
}
-struct multi_pack_index *load_multi_pack_index(const char *object_dir,
+struct multi_pack_index *load_multi_pack_index(struct repository *r,
+ const char *object_dir,
int local)
{
struct strbuf midx_name = STRBUF_INIT;
struct multi_pack_index *m;
- get_midx_filename(&midx_name, object_dir);
+ get_midx_filename(r->hash_algo, &midx_name, object_dir);
- m = load_multi_pack_index_one(object_dir, midx_name.buf, local);
+ m = load_multi_pack_index_one(r, object_dir,
+ midx_name.buf, local);
if (!m)
- m = load_multi_pack_index_chain(object_dir, local);
+ m = load_multi_pack_index_chain(r, object_dir, local);
strbuf_release(&midx_name);
@@ -464,7 +473,7 @@ int prepare_midx_pack(struct repository *r, struct multi_pack_index *m,
strhash(key.buf), key.buf,
struct packed_git, packmap_ent);
if (!p) {
- p = add_packed_git(pack_name.buf, pack_name.len, m->local);
+ p = add_packed_git(r, pack_name.buf, pack_name.len, m->local);
if (p) {
install_packed_git(r, p);
list_add_tail(&p->mru, &r->objects->packed_git_mru);
@@ -519,7 +528,7 @@ int bsearch_one_midx(const struct object_id *oid, struct multi_pack_index *m,
uint32_t *result)
{
int ret = bsearch_hash(oid->hash, m->chunk_oid_fanout,
- m->chunk_oid_lookup, the_hash_algo->rawsz,
+ m->chunk_oid_lookup, m->repo->hash_algo->rawsz,
result);
if (result)
*result += m->num_objects_in_base;
@@ -550,7 +559,7 @@ struct object_id *nth_midxed_object_oid(struct object_id *oid,
n = midx_for_object(&m, n);
oidread(oid, m->chunk_oid_lookup + st_mult(m->hash_len, n),
- the_repository->hash_algo);
+ m->repo->hash_algo);
return oid;
}
@@ -721,7 +730,7 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
if (!strcmp(object_dir, m_search->object_dir))
return 1;
- m = load_multi_pack_index(object_dir, local);
+ m = load_multi_pack_index(r, object_dir, local);
if (m) {
struct multi_pack_index *mp = r->objects->multi_pack_index;
@@ -815,7 +824,7 @@ void clear_midx_file(struct repository *r)
{
struct strbuf midx = STRBUF_INIT;
- get_midx_filename(&midx, r->objects->odb->path);
+ get_midx_filename(r->hash_algo, &midx, r->objects->odb->path);
if (r->objects && r->objects->multi_pack_index) {
close_midx(r->objects->multi_pack_index);
@@ -875,7 +884,7 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
struct pair_pos_vs_id *pairs = NULL;
uint32_t i;
struct progress *progress = NULL;
- struct multi_pack_index *m = load_multi_pack_index(object_dir, 1);
+ struct multi_pack_index *m = load_multi_pack_index(r, object_dir, 1);
struct multi_pack_index *curr;
verify_midx_error = 0;
@@ -884,7 +893,7 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
struct stat sb;
struct strbuf filename = STRBUF_INIT;
- get_midx_filename(&filename, object_dir);
+ get_midx_filename(r->hash_algo, &filename, object_dir);
if (!stat(filename.buf, &sb)) {
error(_("multi-pack-index file exists, but failed to parse"));
@@ -898,7 +907,8 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
midx_report(_("incorrect checksum"));
if (flags & MIDX_PROGRESS)
- progress = start_delayed_progress(_("Looking for referenced packfiles"),
+ progress = start_delayed_progress(r,
+ _("Looking for referenced packfiles"),
m->num_packs + m->num_packs_in_base);
for (i = 0; i < m->num_packs + m->num_packs_in_base; i++) {
if (prepare_midx_pack(r, m, i))
@@ -918,7 +928,8 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
}
if (flags & MIDX_PROGRESS)
- progress = start_sparse_progress(_("Verifying OID order in multi-pack-index"),
+ progress = start_sparse_progress(r,
+ _("Verifying OID order in multi-pack-index"),
m->num_objects - 1);
for (curr = m; curr; curr = curr->base_midx) {
@@ -950,14 +961,17 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
}
if (flags & MIDX_PROGRESS)
- progress = start_sparse_progress(_("Sorting objects by packfile"),
+ progress = start_sparse_progress(r,
+ _("Sorting objects by packfile"),
m->num_objects);
display_progress(progress, 0); /* TODO: Measure QSORT() progress */
QSORT(pairs, m->num_objects, compare_pair_pos_vs_id);
stop_progress(&progress);
if (flags & MIDX_PROGRESS)
- progress = start_sparse_progress(_("Verifying object offsets"), m->num_objects);
+ progress = start_sparse_progress(r,
+ _("Verifying object offsets"),
+ m->num_objects);
for (i = 0; i < m->num_objects + m->num_objects_in_base; i++) {
struct object_id oid;
struct pack_entry e;
diff --git a/midx.h b/midx.h
index 42d4f8d149..9d1374cbd5 100644
--- a/midx.h
+++ b/midx.h
@@ -7,6 +7,7 @@ struct object_id;
struct pack_entry;
struct repository;
struct bitmapped_pack;
+struct git_hash_algo;
#define MIDX_SIGNATURE 0x4d494458 /* "MIDX" */
#define MIDX_VERSION 1
@@ -71,6 +72,9 @@ struct multi_pack_index {
const char **pack_names;
struct packed_git **packs;
+
+ struct repository *repo;
+
char object_dir[FLEX_ARRAY];
};
@@ -86,15 +90,20 @@ struct multi_pack_index {
#define MIDX_EXT_MIDX "midx"
const unsigned char *get_midx_checksum(struct multi_pack_index *m);
-void get_midx_filename(struct strbuf *out, const char *object_dir);
-void get_midx_filename_ext(struct strbuf *out, const char *object_dir,
+void get_midx_filename(const struct git_hash_algo *hash_algo,
+ struct strbuf *out, const char *object_dir);
+void get_midx_filename_ext(const struct git_hash_algo *hash_algo,
+ struct strbuf *out, const char *object_dir,
const unsigned char *hash, const char *ext);
void get_midx_chain_dirname(struct strbuf *buf, const char *object_dir);
void get_midx_chain_filename(struct strbuf *buf, const char *object_dir);
-void get_split_midx_filename_ext(struct strbuf *buf, const char *object_dir,
+void get_split_midx_filename_ext(const struct git_hash_algo *hash_algo,
+ struct strbuf *buf, const char *object_dir,
const unsigned char *hash, const char *ext);
-struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
+struct multi_pack_index *load_multi_pack_index(struct repository *r,
+ const char *object_dir,
+ int local);
int prepare_midx_pack(struct repository *r, struct multi_pack_index *m, uint32_t pack_int_id);
struct packed_git *nth_midxed_pack(struct multi_pack_index *m,
uint32_t pack_int_id);
@@ -120,15 +129,13 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
* Variant of write_midx_file which writes a MIDX containing only the packs
* specified in packs_to_include.
*/
-int write_midx_file(const char *object_dir,
- const char *preferred_pack_name,
- const char *refs_snapshot,
+int write_midx_file(struct repository *r, const char *object_dir,
+ const char *preferred_pack_name, const char *refs_snapshot,
unsigned flags);
-int write_midx_file_only(const char *object_dir,
+int write_midx_file_only(struct repository *r, const char *object_dir,
struct string_list *packs_to_include,
const char *preferred_pack_name,
- const char *refs_snapshot,
- unsigned flags);
+ const char *refs_snapshot, unsigned flags);
void clear_midx_file(struct repository *r);
int verify_midx_file(struct repository *r, const char *object_dir, unsigned flags);
int expire_midx_packs(struct repository *r, const char *object_dir, unsigned flags);
diff --git a/name-hash.c b/name-hash.c
index 95528e3bcd..d66de1cdfd 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -7,6 +7,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
diff --git a/negotiator/skipping.c b/negotiator/skipping.c
index abedb70a48..616df6bf3a 100644
--- a/negotiator/skipping.c
+++ b/negotiator/skipping.c
@@ -134,7 +134,6 @@ static int push_parent(struct data *data, struct entry *entry,
struct entry *parent_entry;
if (to_push->object.flags & SEEN) {
- int i;
if (to_push->object.flags & POPPED)
/*
* The entry for this commit has already been popped,
@@ -145,7 +144,7 @@ static int push_parent(struct data *data, struct entry *entry,
/*
* Find the existing entry and use it.
*/
- for (i = 0; i < data->rev_list.nr; i++) {
+ for (size_t i = 0; i < data->rev_list.nr; i++) {
parent_entry = data->rev_list.array[i].data;
if (parent_entry->commit == to_push)
goto parent_found;
@@ -248,7 +247,7 @@ static int ack(struct fetch_negotiator *n, struct commit *c)
static void release(struct fetch_negotiator *n)
{
struct data *data = n->data;
- for (int i = 0; i < data->rev_list.nr; i++)
+ for (size_t i = 0; i < data->rev_list.nr; i++)
free(data->rev_list.array[i].data);
clear_prio_queue(&data->rev_list);
FREE_AND_NULL(data);
diff --git a/notes-merge.c b/notes-merge.c
index dadbbabf86..8d701ed428 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "advice.h"
diff --git a/notes.c b/notes.c
index f4f18daf07..f534423050 100644
--- a/notes.c
+++ b/notes.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/object-file-convert.c b/object-file-convert.c
index 3887d6d57b..eba71955cf 100644
--- a/object-file-convert.c
+++ b/object-file-convert.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/object-file.c b/object-file.c
index 891eaa2b4b..aeca61b8ae 100644
--- a/object-file.c
+++ b/object-file.c
@@ -8,6 +8,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -1969,54 +1970,59 @@ static void write_object_file_prepare_literally(const struct git_hash_algo *algo
hash_object_body(algo, &c, buf, len, oid, hdr, hdrlen);
}
-static int check_collision(const char *filename_a, const char *filename_b)
+#define CHECK_COLLISION_DEST_VANISHED -2
+
+static int check_collision(const char *source, const char *dest)
{
- char buf_a[4096], buf_b[4096];
- int fd_a = -1, fd_b = -1;
+ char buf_source[4096], buf_dest[4096];
+ int fd_source = -1, fd_dest = -1;
int ret = 0;
- fd_a = open(filename_a, O_RDONLY);
- if (fd_a < 0) {
- ret = error_errno(_("unable to open %s"), filename_a);
+ fd_source = open(source, O_RDONLY);
+ if (fd_source < 0) {
+ ret = error_errno(_("unable to open %s"), source);
goto out;
}
- fd_b = open(filename_b, O_RDONLY);
- if (fd_b < 0) {
- ret = error_errno(_("unable to open %s"), filename_b);
+ fd_dest = open(dest, O_RDONLY);
+ if (fd_dest < 0) {
+ if (errno != ENOENT)
+ ret = error_errno(_("unable to open %s"), dest);
+ else
+ ret = CHECK_COLLISION_DEST_VANISHED;
goto out;
}
while (1) {
ssize_t sz_a, sz_b;
- sz_a = read_in_full(fd_a, buf_a, sizeof(buf_a));
+ sz_a = read_in_full(fd_source, buf_source, sizeof(buf_source));
if (sz_a < 0) {
- ret = error_errno(_("unable to read %s"), filename_a);
+ ret = error_errno(_("unable to read %s"), source);
goto out;
}
- sz_b = read_in_full(fd_b, buf_b, sizeof(buf_b));
+ sz_b = read_in_full(fd_dest, buf_dest, sizeof(buf_dest));
if (sz_b < 0) {
- ret = error_errno(_("unable to read %s"), filename_b);
+ ret = error_errno(_("unable to read %s"), dest);
goto out;
}
- if (sz_a != sz_b || memcmp(buf_a, buf_b, sz_a)) {
+ if (sz_a != sz_b || memcmp(buf_source, buf_dest, sz_a)) {
ret = error(_("files '%s' and '%s' differ in contents"),
- filename_a, filename_b);
+ source, dest);
goto out;
}
- if (sz_a < sizeof(buf_a))
+ if (sz_a < sizeof(buf_source))
break;
}
out:
- if (fd_a > -1)
- close(fd_a);
- if (fd_b > -1)
- close(fd_b);
+ if (fd_source > -1)
+ close(fd_source);
+ if (fd_dest > -1)
+ close(fd_dest);
return ret;
}
@@ -2031,8 +2037,11 @@ int finalize_object_file(const char *tmpfile, const char *filename)
int finalize_object_file_flags(const char *tmpfile, const char *filename,
enum finalize_object_file_flags flags)
{
- struct stat st;
- int ret = 0;
+ unsigned retries = 0;
+ int ret;
+
+retry:
+ ret = 0;
if (object_creation_mode == OBJECT_CREATION_USES_RENAMES)
goto try_rename;
@@ -2053,6 +2062,8 @@ int finalize_object_file_flags(const char *tmpfile, const char *filename,
* left to unlink.
*/
if (ret && ret != EEXIST) {
+ struct stat st;
+
try_rename:
if (!stat(filename, &st))
ret = EEXIST;
@@ -2068,9 +2079,17 @@ int finalize_object_file_flags(const char *tmpfile, const char *filename,
errno = saved_errno;
return error_errno(_("unable to write file %s"), filename);
}
- if (!(flags & FOF_SKIP_COLLISION_CHECK) &&
- check_collision(tmpfile, filename))
+ if (!(flags & FOF_SKIP_COLLISION_CHECK)) {
+ ret = check_collision(tmpfile, filename);
+ if (ret == CHECK_COLLISION_DEST_VANISHED) {
+ if (retries++ > 5)
+ return error(_("unable to write repeatedly vanishing file %s"),
+ filename);
+ goto retry;
+ }
+ else if (ret)
return -1;
+ }
unlink_or_warn(tmpfile);
}
diff --git a/object-name.c b/object-name.c
index c892fbe80a..945d5bdef2 100644
--- a/object-name.c
+++ b/object-name.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "object-name.h"
@@ -952,7 +953,7 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
"\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\"");
+ "running \"git config set advice.objectNameWarning false\"");
struct object_id tmp_oid;
char *real_ref = NULL;
int refs_found = 0;
@@ -1271,6 +1272,58 @@ static int peel_onion(struct repository *r, const char *name, int len,
return 0;
}
+/*
+ * Documentation/revisions.txt says:
+ * '<describeOutput>', e.g. 'v1.7.4.2-679-g3bee7fb'::
+ * Output from `git describe`; i.e. a closest tag, optionally
+ * followed by a dash and a number of commits, followed by a dash, a
+ * 'g', and an abbreviated object name.
+ *
+ * which means that the stuff before '-g${HASH}' needs to be a valid
+ * refname, a dash, and a non-negative integer. This function verifies
+ * that.
+ *
+ * In particular, we do not want to treat
+ * branchname:path/to/file/named/i-gaffed
+ * as a request for commit affed.
+ *
+ * More generally, we should probably not treat
+ * 'refs/heads/./../.../ ~^:/?*[////\\\&}/busted.lock-g050e0ef6ead'
+ * as a request for object 050e0ef6ead either.
+ *
+ * We are called with name[len] == '-' and name[len+1] == 'g', i.e.
+ * we are verifying ${REFNAME}-{INTEGER} part of the name.
+ */
+static int ref_and_count_parts_valid(const char *name, int len)
+{
+ struct strbuf sb;
+ const char *cp;
+ int flags = REFNAME_ALLOW_ONELEVEL;
+ int ret = 1;
+
+ /* Ensure we have at least one digit */
+ if (!isxdigit(name[len-1]))
+ return 0;
+
+ /* Skip over digits backwards until we get to the dash */
+ for (cp = name + len - 2; name < cp; cp--) {
+ if (*cp == '-')
+ break;
+ if (!isxdigit(*cp))
+ return 0;
+ }
+ /* Ensure we found the leading dash */
+ if (*cp != '-')
+ return 0;
+
+ len = cp - name;
+ strbuf_init(&sb, len);
+ strbuf_add(&sb, name, len);
+ ret = !check_refname_format(sb.buf, flags);
+ strbuf_release(&sb);
+ return ret;
+}
+
static int get_describe_name(struct repository *r,
const char *name, int len,
struct object_id *oid)
@@ -1284,7 +1337,8 @@ static int get_describe_name(struct repository *r,
/* We must be looking at g in "SOMETHING-g"
* for it to be describe output.
*/
- if (ch == 'g' && cp[-1] == '-') {
+ if (ch == 'g' && cp[-1] == '-' &&
+ ref_and_count_parts_valid(name, cp - 1 - name)) {
cp++;
len -= cp - name;
return get_short_oid(r,
@@ -1401,7 +1455,7 @@ static int get_oid_oneline(struct repository *r,
const char *prefix, struct object_id *oid,
const struct commit_list *list)
{
- struct commit_list *copy = NULL;
+ struct commit_list *copy = NULL, **copy_tail = &copy;
const struct commit_list *l;
int found = 0;
int negative = 0;
@@ -1423,7 +1477,7 @@ static int get_oid_oneline(struct repository *r,
for (l = list; l; l = l->next) {
l->item->object.flags |= ONELINE_SEEN;
- commit_list_insert(l->item, &copy);
+ copy_tail = &commit_list_insert(l->item, copy_tail)->next;
}
while (copy) {
const char *p, *buf;
@@ -1734,42 +1788,6 @@ int repo_interpret_branch_name(struct repository *r,
return -1;
}
-void strbuf_branchname(struct strbuf *sb, const char *name, unsigned allowed)
-{
- int len = strlen(name);
- struct interpret_branch_name_options options = {
- .allowed = allowed
- };
- int used = repo_interpret_branch_name(the_repository, name, len, sb,
- &options);
-
- if (used < 0)
- used = 0;
- strbuf_add(sb, name + used, len - used);
-}
-
-int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
-{
- if (startup_info->have_repository)
- strbuf_branchname(sb, name, INTERPRET_BRANCH_LOCAL);
- else
- strbuf_addstr(sb, name);
-
- /*
- * This splice must be done even if we end up rejecting the
- * name; builtin/branch.c::copy_or_rename_branch() still wants
- * to see what the name expanded to so that "branch -m" can be
- * used as a tool to correct earlier mistakes.
- */
- strbuf_splice(sb, 0, 0, "refs/heads/", 11);
-
- if (*name == '-' ||
- !strcmp(sb->buf, "refs/heads/HEAD"))
- return -1;
-
- return check_refname_format(sb->buf, 0);
-}
-
void object_context_release(struct object_context *ctx)
{
free(ctx->path);
@@ -2087,12 +2105,14 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,
return -1;
}
for (cp = name, bracket_depth = 0; *cp; cp++) {
- if (*cp == '{')
+ if (strchr("@^", *cp) && cp[1] == '{') {
+ cp++;
bracket_depth++;
- else if (bracket_depth && *cp == '}')
+ } else if (bracket_depth && *cp == '}') {
bracket_depth--;
- else if (!bracket_depth && *cp == ':')
+ } else if (!bracket_depth && *cp == ':') {
break;
+ }
}
if (*cp == ':') {
struct object_id tree_oid;
diff --git a/object-store-ll.h b/object-store-ll.h
index 53b8e693b1..cd3bd5bd99 100644
--- a/object-store-ll.h
+++ b/object-store-ll.h
@@ -10,6 +10,7 @@
struct oidmap;
struct oidtree;
struct strbuf;
+struct repository;
struct object_directory {
struct object_directory *next;
@@ -135,6 +136,10 @@ struct packed_git {
*/
const uint32_t *mtimes_map;
size_t mtimes_size;
+
+ /* repo denotes the repository this packfile belongs to */
+ struct repository *repo;
+
/* something like ".git/objects/pack/xxxxx.pack" */
char pack_name[FLEX_ARRAY]; /* more */
};
@@ -545,7 +550,7 @@ typedef int each_packed_object_fn(const struct object_id *oid,
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);
+int for_each_packed_object(struct repository *repo, each_packed_object_fn cb,
+ void *data, enum for_each_object_flags flags);
#endif /* OBJECT_STORE_LL_H */
diff --git a/object.c b/object.c
index 94ea8fb8d2..100bf9b8d1 100644
--- a/object.c
+++ b/object.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/oss-fuzz/.gitignore b/oss-fuzz/.gitignore
index a877c11f42..f2d74de457 100644
--- a/oss-fuzz/.gitignore
+++ b/oss-fuzz/.gitignore
@@ -1,5 +1,8 @@
fuzz-commit-graph
fuzz-config
+fuzz-credential-from-url-gently
fuzz-date
fuzz-pack-headers
fuzz-pack-idx
+fuzz-parse-attr-line
+fuzz-url-decode-mem
diff --git a/oss-fuzz/fuzz-credential-from-url-gently.c b/oss-fuzz/fuzz-credential-from-url-gently.c
new file mode 100644
index 0000000000..c872f9ad2d
--- /dev/null
+++ b/oss-fuzz/fuzz-credential-from-url-gently.c
@@ -0,0 +1,32 @@
+#include "git-compat-util.h"
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include "credential.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ struct credential c;
+ char *buf;
+
+ buf = malloc(size + 1);
+ if (!buf)
+ return 0;
+
+ memcpy(buf, data, size);
+ buf[size] = 0;
+
+ // start fuzzing
+ credential_init(&c);
+ credential_from_url_gently(&c, buf, 1);
+
+ // cleanup
+ credential_clear(&c);
+ free(buf);
+
+ return 0;
+}
diff --git a/oss-fuzz/fuzz-parse-attr-line.c b/oss-fuzz/fuzz-parse-attr-line.c
new file mode 100644
index 0000000000..315198505c
--- /dev/null
+++ b/oss-fuzz/fuzz-parse-attr-line.c
@@ -0,0 +1,41 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
+#include "git-compat-util.h"
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include "attr.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ struct match_attr *res;
+ char *buf;
+
+ buf = malloc(size + 1);
+ if (!buf)
+ return 0;
+
+ memcpy(buf, data, size);
+ buf[size] = 0;
+
+ res = parse_attr_line(buf, "dummy", 0, 0);
+
+ if (res) {
+ size_t j;
+ for (j = 0; j < res->num_attr; j++) {
+ const char *setto = res->state[j].setto;
+ if (ATTR_TRUE(setto) || ATTR_FALSE(setto) ||
+ ATTR_UNSET(setto))
+ ;
+ else
+ free((char *)setto);
+ }
+ free(res);
+ }
+ free(buf);
+
+ return 0;
+}
diff --git a/oss-fuzz/fuzz-url-decode-mem.c b/oss-fuzz/fuzz-url-decode-mem.c
new file mode 100644
index 0000000000..2342aa993b
--- /dev/null
+++ b/oss-fuzz/fuzz-url-decode-mem.c
@@ -0,0 +1,43 @@
+#include "git-compat-util.h"
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include "url.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ char *buf;
+ char *r;
+ const char *pbuf;
+
+ buf = malloc(size + 1);
+ if (!buf)
+ return 0;
+
+ memcpy(buf, data, size);
+ buf[size] = 0;
+
+ // start fuzzing
+ r = url_decode(buf);
+ free(r);
+
+ r = url_percent_decode(buf);
+ free(r);
+
+ pbuf = (const char*) buf;
+ r = url_decode_parameter_name(&pbuf);
+ free(r);
+
+ pbuf = (const char*) buf;
+ r = url_decode_parameter_value(&pbuf);
+ free(r);
+
+ // cleanup
+ free(buf);
+
+ return 0;
+}
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index 49758e2525..a06a1f35c6 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
@@ -589,7 +590,8 @@ int bitmap_writer_build(struct bitmap_writer *writer)
int closed = 1; /* until proven otherwise */
if (writer->show_progress)
- writer->progress = start_progress("Building bitmaps",
+ writer->progress = start_progress(the_repository,
+ "Building bitmaps",
writer->selected_nr);
trace2_region_enter("pack-bitmap-write", "building_bitmaps_total",
the_repository);
@@ -709,7 +711,8 @@ void bitmap_writer_select_commits(struct bitmap_writer *writer,
}
if (writer->show_progress)
- writer->progress = start_progress("Selecting bitmap commits", 0);
+ writer->progress = start_progress(the_repository,
+ "Selecting bitmap commits", 0);
for (;;) {
struct commit *chosen = NULL;
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 683f467051..6406953d32 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "commit.h"
@@ -177,12 +177,21 @@ static uint32_t bitmap_num_objects(struct bitmap_index *index)
return index->pack->num_objects;
}
+static struct repository *bitmap_repo(struct bitmap_index *bitmap_git)
+{
+ if (bitmap_is_midx(bitmap_git))
+ return bitmap_git->midx->repo;
+ return bitmap_git->pack->repo;
+}
+
static int load_bitmap_header(struct bitmap_index *index)
{
struct bitmap_disk_header *header = (void *)index->map;
- size_t header_size = sizeof(*header) - GIT_MAX_RAWSZ + the_hash_algo->rawsz;
+ const struct git_hash_algo *hash_algo = bitmap_repo(index)->hash_algo;
+
+ size_t header_size = sizeof(*header) - GIT_MAX_RAWSZ + hash_algo->rawsz;
- if (index->map_size < header_size + the_hash_algo->rawsz)
+ if (index->map_size < header_size + hash_algo->rawsz)
return error(_("corrupted bitmap index (too small)"));
if (memcmp(header->magic, BITMAP_IDX_SIGNATURE, sizeof(BITMAP_IDX_SIGNATURE)) != 0)
@@ -196,7 +205,7 @@ static int load_bitmap_header(struct bitmap_index *index)
{
uint32_t flags = ntohs(header->options);
size_t cache_size = st_mult(bitmap_num_objects(index), sizeof(uint32_t));
- unsigned char *index_end = index->map + index->map_size - the_hash_algo->rawsz;
+ unsigned char *index_end = index->map + index->map_size - hash_algo->rawsz;
if ((flags & BITMAP_OPT_FULL_DAG) == 0)
BUG("unsupported options for bitmap index file "
@@ -368,8 +377,8 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
char *midx_bitmap_filename(struct multi_pack_index *midx)
{
struct strbuf buf = STRBUF_INIT;
- get_midx_filename_ext(&buf, midx->object_dir, get_midx_checksum(midx),
- MIDX_EXT_BITMAP);
+ get_midx_filename_ext(midx->repo->hash_algo, &buf, midx->object_dir,
+ get_midx_checksum(midx), MIDX_EXT_BITMAP);
return strbuf_detach(&buf, NULL);
}
@@ -389,8 +398,7 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
struct stat st;
char *bitmap_name = midx_bitmap_filename(midx);
int fd = git_open(bitmap_name);
- uint32_t i, preferred_pack;
- struct packed_git *preferred;
+ uint32_t i;
if (fd < 0) {
if (errno != ENOENT)
@@ -408,8 +416,8 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
if (bitmap_git->pack || bitmap_git->midx) {
struct strbuf buf = STRBUF_INIT;
- get_midx_filename(&buf, midx->object_dir);
- trace2_data_string("bitmap", the_repository,
+ get_midx_filename(midx->repo->hash_algo, &buf, midx->object_dir);
+ trace2_data_string("bitmap", bitmap_repo(bitmap_git),
"ignoring extra midx bitmap file", buf.buf);
close(fd);
strbuf_release(&buf);
@@ -427,7 +435,7 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
goto cleanup;
if (!hasheq(get_midx_checksum(bitmap_git->midx), bitmap_git->checksum,
- the_repository->hash_algo)) {
+ bitmap_repo(bitmap_git)->hash_algo)) {
error(_("checksum doesn't match in MIDX and bitmap"));
goto cleanup;
}
@@ -438,25 +446,15 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
}
for (i = 0; i < bitmap_git->midx->num_packs; i++) {
- if (prepare_midx_pack(the_repository, bitmap_git->midx, i)) {
+ if (prepare_midx_pack(bitmap_repo(bitmap_git),
+ bitmap_git->midx,
+ i)) {
warning(_("could not open pack %s"),
bitmap_git->midx->pack_names[i]);
goto cleanup;
}
}
- if (midx_preferred_pack(bitmap_git->midx, &preferred_pack) < 0) {
- warning(_("could not determine MIDX preferred pack"));
- goto cleanup;
- }
-
- preferred = bitmap_git->midx->packs[preferred_pack];
- if (!is_pack_valid(preferred)) {
- warning(_("preferred pack (%s) is invalid"),
- preferred->pack_name);
- goto cleanup;
- }
-
return 0;
cleanup:
@@ -492,8 +490,9 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
}
if (bitmap_git->pack || bitmap_git->midx) {
- trace2_data_string("bitmap", the_repository,
- "ignoring extra bitmap file", packfile->pack_name);
+ trace2_data_string("bitmap", bitmap_repo(bitmap_git),
+ "ignoring extra bitmap file",
+ packfile->pack_name);
close(fd);
return -1;
}
@@ -518,8 +517,8 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
return -1;
}
- trace2_data_string("bitmap", the_repository, "opened bitmap file",
- packfile->pack_name);
+ trace2_data_string("bitmap", bitmap_repo(bitmap_git),
+ "opened bitmap file", packfile->pack_name);
return 0;
}
@@ -649,7 +648,7 @@ 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 repository *r = midx->repo;
struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git));
if (!open_midx_bitmap_1(bitmap_git, midx) && !load_bitmap(r, bitmap_git))
@@ -1213,6 +1212,7 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
{
struct bitmap_boundary_cb cb;
struct object_list *root;
+ struct repository *repo;
unsigned int i;
unsigned int tmp_blobs, tmp_trees, tmp_tags;
int any_missing = 0;
@@ -1222,6 +1222,8 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
cb.base = bitmap_new();
object_array_init(&cb.boundary);
+ repo = bitmap_repo(bitmap_git);
+
revs->ignore_missing_links = 1;
if (bitmap_git->pseudo_merges.nr) {
@@ -1280,19 +1282,19 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
* 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);
+ trace2_region_enter("pack-bitmap", "boundary-prepare", repo);
if (prepare_revision_walk(revs))
die("revision walk setup failed");
- trace2_region_leave("pack-bitmap", "boundary-prepare", the_repository);
+ trace2_region_leave("pack-bitmap", "boundary-prepare", repo);
- trace2_region_enter("pack-bitmap", "boundary-traverse", the_repository);
+ trace2_region_enter("pack-bitmap", "boundary-traverse", repo);
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);
+ trace2_region_leave("pack-bitmap", "boundary-traverse", repo);
revs->blob_objects = tmp_blobs;
revs->tree_objects = tmp_trees;
@@ -1304,7 +1306,7 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
/*
* Then add the boundary commit(s) as fill-in traversal tips.
*/
- trace2_region_enter("pack-bitmap", "boundary-fill-in", the_repository);
+ trace2_region_enter("pack-bitmap", "boundary-fill-in", repo);
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))
@@ -1314,7 +1316,7 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
}
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);
+ trace2_region_leave("pack-bitmap", "boundary-fill-in", repo);
cleanup:
object_array_clear(&cb.boundary);
@@ -1718,7 +1720,8 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
ofs = pack_pos_to_offset(pack, pos);
}
- if (packed_object_info(the_repository, pack, ofs, &oi) < 0) {
+ if (packed_object_info(bitmap_repo(bitmap_git), pack, ofs,
+ &oi) < 0) {
struct object_id oid;
nth_bitmap_object_oid(bitmap_git, &oid,
pack_pos_to_index(pack, pos));
@@ -1727,7 +1730,8 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
} else {
struct eindex *eindex = &bitmap_git->ext_index;
struct object *obj = eindex->objects[pos - bitmap_num_objects(bitmap_git)];
- if (oid_object_info_extended(the_repository, &obj->oid, &oi, 0) < 0)
+ if (oid_object_info_extended(bitmap_repo(bitmap_git), &obj->oid,
+ &oi, 0) < 0)
die(_("unable to get size of %s"), oid_to_hex(&obj->oid));
}
@@ -1889,7 +1893,8 @@ static void filter_packed_objects_from_bitmap(struct bitmap_index *bitmap_git,
bitmap_unset(result, i);
for (i = 0; i < eindex->count; ++i) {
- if (has_object_pack(&eindex->objects[i]->oid))
+ if (has_object_pack(bitmap_repo(bitmap_git),
+ &eindex->objects[i]->oid))
bitmap_unset(result, objects_nr + i);
}
}
@@ -1907,6 +1912,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
struct bitmap *haves_bitmap = NULL;
struct bitmap_index *bitmap_git;
+ struct repository *repo;
/*
* We can't do pathspec limiting with bitmaps, because we don't know
@@ -1980,18 +1986,20 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
if (!use_boundary_traversal)
object_array_clear(&revs->pending);
+ repo = bitmap_repo(bitmap_git);
+
if (haves) {
if (use_boundary_traversal) {
- trace2_region_enter("pack-bitmap", "haves/boundary", the_repository);
+ trace2_region_enter("pack-bitmap", "haves/boundary", repo);
haves_bitmap = find_boundary_objects(bitmap_git, revs, haves);
- trace2_region_leave("pack-bitmap", "haves/boundary", the_repository);
+ trace2_region_leave("pack-bitmap", "haves/boundary", repo);
} else {
- trace2_region_enter("pack-bitmap", "haves/classic", the_repository);
+ trace2_region_enter("pack-bitmap", "haves/classic", repo);
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);
+ trace2_region_leave("pack-bitmap", "haves/classic", repo);
}
if (!haves_bitmap)
@@ -2025,17 +2033,17 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
object_list_free(&wants);
object_list_free(&haves);
- trace2_data_intmax("bitmap", the_repository, "pseudo_merges_satisfied",
+ trace2_data_intmax("bitmap", repo, "pseudo_merges_satisfied",
pseudo_merges_satisfied_nr);
- trace2_data_intmax("bitmap", the_repository, "pseudo_merges_cascades",
+ trace2_data_intmax("bitmap", repo, "pseudo_merges_cascades",
pseudo_merges_cascades_nr);
- trace2_data_intmax("bitmap", the_repository, "bitmap/hits",
+ trace2_data_intmax("bitmap", repo, "bitmap/hits",
existing_bitmaps_hits_nr);
- trace2_data_intmax("bitmap", the_repository, "bitmap/misses",
+ trace2_data_intmax("bitmap", repo, "bitmap/misses",
existing_bitmaps_misses_nr);
- trace2_data_intmax("bitmap", the_repository, "bitmap/roots_with_bitmap",
+ trace2_data_intmax("bitmap", repo, "bitmap/roots_with_bitmap",
roots_with_bitmaps_nr);
- trace2_data_intmax("bitmap", the_repository, "bitmap/roots_without_bitmap",
+ trace2_data_intmax("bitmap", repo, "bitmap/roots_without_bitmap",
roots_without_bitmaps_nr);
return bitmap_git;
@@ -2256,7 +2264,7 @@ void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
struct bitmap **reuse_out,
int multi_pack_reuse)
{
- struct repository *r = the_repository;
+ struct repository *r = bitmap_repo(bitmap_git);
struct bitmapped_pack *packs = NULL;
struct bitmap *result = bitmap_git->result;
struct bitmap *reuse;
@@ -2285,8 +2293,10 @@ void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
if (!pack.bitmap_nr)
continue;
- ALLOC_GROW(packs, packs_nr + 1, packs_alloc);
- memcpy(&packs[packs_nr++], &pack, sizeof(pack));
+ if (is_pack_valid(pack.p)) {
+ ALLOC_GROW(packs, packs_nr + 1, packs_alloc);
+ memcpy(&packs[packs_nr++], &pack, sizeof(pack));
+ }
objects_nr += pack.p->num_objects;
}
@@ -2320,16 +2330,22 @@ void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
pack_int_id = -1;
}
- ALLOC_GROW(packs, packs_nr + 1, packs_alloc);
- packs[packs_nr].p = pack;
- packs[packs_nr].pack_int_id = pack_int_id;
- packs[packs_nr].bitmap_nr = pack->num_objects;
- packs[packs_nr].bitmap_pos = 0;
- packs[packs_nr].from_midx = bitmap_git->midx;
+ if (is_pack_valid(pack)) {
+ ALLOC_GROW(packs, packs_nr + 1, packs_alloc);
+ packs[packs_nr].p = pack;
+ packs[packs_nr].pack_int_id = pack_int_id;
+ packs[packs_nr].bitmap_nr = pack->num_objects;
+ packs[packs_nr].bitmap_pos = 0;
+ packs[packs_nr].from_midx = bitmap_git->midx;
+ packs_nr++;
+ }
- objects_nr = packs[packs_nr++].bitmap_nr;
+ objects_nr = pack->num_objects;
}
+ if (!packs_nr)
+ return;
+
word_alloc = objects_nr / BITS_IN_EWORD;
if (objects_nr % BITS_IN_EWORD)
word_alloc++;
@@ -2557,7 +2573,9 @@ void test_bitmap_walk(struct rev_info *revs)
tdata.trees = ewah_to_bitmap(bitmap_git->trees);
tdata.blobs = ewah_to_bitmap(bitmap_git->blobs);
tdata.tags = ewah_to_bitmap(bitmap_git->tags);
- tdata.prg = start_progress("Verifying bitmap entries", result_popcnt);
+ tdata.prg = start_progress(revs->repo,
+ "Verifying bitmap entries",
+ result_popcnt);
tdata.seen = 0;
traverse_commit_list(revs, &test_show_commit, &test_show_object, &tdata);
@@ -2792,7 +2810,7 @@ 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;
+ struct repository *r = bitmap_repo(bitmap_git);
uint32_t i, num_objects;
uint32_t *reposition;
@@ -2948,7 +2966,8 @@ static off_t get_disk_usage_for_extended(struct bitmap_index *bitmap_git)
st_add(bitmap_num_objects(bitmap_git), i)))
continue;
- if (oid_object_info_extended(the_repository, &obj->oid, &oi, 0) < 0)
+ if (oid_object_info_extended(bitmap_repo(bitmap_git), &obj->oid,
+ &oi, 0) < 0)
die(_("unable to get disk usage of '%s'"),
oid_to_hex(&obj->oid));
diff --git a/pack-check.c b/pack-check.c
index e883dae3f2..8d9f6da7ce 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
diff --git a/pack-objects.h b/pack-objects.h
index b9898a4e64..3f6f504203 100644
--- a/pack-objects.h
+++ b/pack-objects.h
@@ -7,7 +7,8 @@
struct repository;
-#define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024)
+#define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024)
+#define DEFAULT_DELTA_BASE_CACHE_LIMIT (96 * 1024 * 1024)
#define OE_DFS_STATE_BITS 2
#define OE_DEPTH_BITS 12
diff --git a/pack-revindex.c b/pack-revindex.c
index 22d3c23464..d3832478d9 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -383,7 +383,7 @@ int load_midx_revindex(struct multi_pack_index *m)
trace2_data_string("load_midx_revindex", the_repository,
"source", "rev");
- get_midx_filename_ext(&revindex_name, m->object_dir,
+ get_midx_filename_ext(m->repo->hash_algo, &revindex_name, m->object_dir,
get_midx_checksum(m), MIDX_EXT_REV);
ret = load_revindex_from_disk(revindex_name.buf,
diff --git a/pack-write.c b/pack-write.c
index 8c7dfddc5a..98a8c0e785 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -21,6 +21,7 @@ void reset_pack_idx_option(struct pack_idx_option *opts)
memset(opts, 0, sizeof(*opts));
opts->version = 2;
opts->off32_limit = 0x7fffffff;
+ opts->delta_base_cache_limit = DEFAULT_DELTA_BASE_CACHE_LIMIT;
}
static int sha1_compare(const void *_a, const void *_b)
diff --git a/pack.h b/pack.h
index 02bbdfb19c..78f8d8b213 100644
--- a/pack.h
+++ b/pack.h
@@ -13,7 +13,8 @@ struct repository;
*/
#define PACK_SIGNATURE 0x5041434b /* "PACK" */
#define PACK_VERSION 2
-#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))
+#define pack_version_ok(v) pack_version_ok_native(ntohl(v))
+#define pack_version_ok_native(v) ((v) == 2 || (v) == 3)
struct pack_header {
uint32_t hdr_signature;
uint32_t hdr_version;
@@ -58,6 +59,8 @@ struct pack_idx_option {
*/
int anomaly_alloc, anomaly_nr;
uint32_t *anomaly;
+
+ size_t delta_base_cache_limit;
};
void reset_pack_idx_option(struct pack_idx_option *);
diff --git a/packfile.c b/packfile.c
index 9560f0a33c..2d80d80cb3 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
@@ -25,13 +25,12 @@
#include "pack-revindex.h"
#include "promisor-remote.h"
-char *odb_pack_name(struct strbuf *buf,
- const unsigned char *hash,
- const char *ext)
+char *odb_pack_name(struct repository *r, struct strbuf *buf,
+ const unsigned char *hash, const char *ext)
{
strbuf_reset(buf);
- strbuf_addf(buf, "%s/pack/pack-%s.%s", repo_get_object_directory(the_repository),
- hash_to_hex(hash), ext);
+ strbuf_addf(buf, "%s/pack/pack-%s.%s", repo_get_object_directory(r),
+ hash_to_hex_algop(hash, r->hash_algo), ext);
return buf->buf;
}
@@ -47,15 +46,15 @@ static size_t pack_mapped;
#define SZ_FMT PRIuMAX
static inline uintmax_t sz_fmt(size_t s) { return s; }
-void pack_report(void)
+void pack_report(struct repository *repo)
{
fprintf(stderr,
"pack_report: getpagesize() = %10" SZ_FMT "\n"
"pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
"pack_report: core.packedGitLimit = %10" SZ_FMT "\n",
sz_fmt(getpagesize()),
- sz_fmt(packed_git_window_size),
- sz_fmt(packed_git_limit));
+ sz_fmt(repo->settings.packed_git_window_size),
+ sz_fmt(repo->settings.packed_git_limit));
fprintf(stderr,
"pack_report: pack_used_ctr = %10u\n"
"pack_report: pack_mmap_calls = %10u\n"
@@ -79,7 +78,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
size_t idx_size;
int fd = git_open(path), ret;
struct stat st;
- const unsigned int hashsz = the_hash_algo->rawsz;
+ const unsigned int hashsz = p->repo->hash_algo->rawsz;
if (fd < 0)
return -1;
@@ -217,11 +216,12 @@ uint32_t get_pack_fanout(struct packed_git *p, uint32_t value)
return ntohl(level1_ofs[value]);
}
-static struct packed_git *alloc_packed_git(int extra)
+static struct packed_git *alloc_packed_git(struct repository *r, int extra)
{
struct packed_git *p = xmalloc(st_add(sizeof(*p), extra));
memset(p, 0, sizeof(*p));
p->pack_fd = -1;
+ p->repo = r;
return p;
}
@@ -233,15 +233,16 @@ static char *pack_path_from_idx(const char *idx_path)
return xstrfmt("%.*s.pack", (int)len, idx_path);
}
-struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path)
+struct packed_git *parse_pack_index(struct repository *r, unsigned char *sha1,
+ const char *idx_path)
{
char *path = pack_path_from_idx(idx_path);
size_t alloc = st_add(strlen(path), 1);
- struct packed_git *p = alloc_packed_git(alloc);
+ struct packed_git *p = alloc_packed_git(r, alloc);
memcpy(p->pack_name, path, alloc); /* includes NUL */
free(path);
- hashcpy(p->hash, sha1, the_repository->hash_algo);
+ hashcpy(p->hash, sha1, p->repo->hash_algo);
if (check_packed_git_idx(idx_path, p)) {
free(p);
return NULL;
@@ -276,7 +277,7 @@ static int unuse_one_window(struct packed_git *current)
if (current)
scan_windows(current, &lru_p, &lru_w, &lru_l);
- for (p = the_repository->objects->packed_git; p; p = p->next)
+ for (p = current->repo->objects->packed_git; p; p = p->next)
scan_windows(p, &lru_p, &lru_w, &lru_l);
if (lru_p) {
munmap(lru_w->base, lru_w->len);
@@ -458,13 +459,13 @@ static void find_lru_pack(struct packed_git *p, struct packed_git **lru_p, struc
*accept_windows_inuse = has_windows_inuse;
}
-static int close_one_pack(void)
+static int close_one_pack(struct repository *r)
{
struct packed_git *p, *lru_p = NULL;
struct pack_window *mru_w = NULL;
int accept_windows_inuse = 1;
- for (p = the_repository->objects->packed_git; p; p = p->next) {
+ for (p = r->objects->packed_git; p; p = p->next) {
if (p->pack_fd == -1)
continue;
find_lru_pack(p, &lru_p, &mru_w, &accept_windows_inuse);
@@ -538,7 +539,7 @@ static int open_packed_git_1(struct packed_git *p)
unsigned char hash[GIT_MAX_RAWSZ];
unsigned char *idx_hash;
ssize_t read_result;
- const unsigned hashsz = the_hash_algo->rawsz;
+ const unsigned hashsz = p->repo->hash_algo->rawsz;
if (open_pack_index(p))
return error("packfile %s index unavailable", p->pack_name);
@@ -553,7 +554,7 @@ static int open_packed_git_1(struct packed_git *p)
pack_max_fds = 1;
}
- while (pack_max_fds <= pack_open_fds && close_one_pack())
+ while (pack_max_fds <= pack_open_fds && close_one_pack(p->repo))
; /* nothing */
p->pack_fd = git_open(p->pack_name);
@@ -595,7 +596,7 @@ static int open_packed_git_1(struct packed_git *p)
if (read_result != hashsz)
return error("packfile %s signature is unavailable", p->pack_name);
idx_hash = ((unsigned char *)p->index_data) + p->index_size - hashsz * 2;
- if (!hasheq(hash, idx_hash, the_repository->hash_algo))
+ if (!hasheq(hash, idx_hash, p->repo->hash_algo))
return error("packfile %s does not match index", p->pack_name);
return 0;
}
@@ -608,7 +609,8 @@ static int open_packed_git(struct packed_git *p)
return -1;
}
-static int in_window(struct pack_window *win, off_t offset)
+static int in_window(struct repository *r, struct pack_window *win,
+ off_t offset)
{
/* We must promise at least one full hash after the
* offset is available from this window, otherwise the offset
@@ -618,7 +620,7 @@ static int in_window(struct pack_window *win, off_t offset)
*/
off_t win_off = win->offset;
return win_off <= offset
- && (offset + the_hash_algo->rawsz) <= (win_off + win->len);
+ && (offset + r->hash_algo->rawsz) <= (win_off + win->len);
}
unsigned char *use_pack(struct packed_git *p,
@@ -635,21 +637,28 @@ unsigned char *use_pack(struct packed_git *p,
*/
if (!p->pack_size && p->pack_fd == -1 && open_packed_git(p))
die("packfile %s cannot be accessed", p->pack_name);
- if (offset > (p->pack_size - the_hash_algo->rawsz))
+ if (offset > (p->pack_size - p->repo->hash_algo->rawsz))
die("offset beyond end of packfile (truncated pack?)");
if (offset < 0)
die(_("offset before end of packfile (broken .idx?)"));
- if (!win || !in_window(win, offset)) {
+ if (!win || !in_window(p->repo, win, offset)) {
if (win)
win->inuse_cnt--;
for (win = p->windows; win; win = win->next) {
- if (in_window(win, offset))
+ if (in_window(p->repo, win, offset))
break;
}
if (!win) {
- size_t window_align = packed_git_window_size / 2;
+ size_t window_align;
off_t len;
+ struct repo_settings *settings;
+
+ /* lazy load the settings in case it hasn't been setup */
+ prepare_repo_settings(p->repo);
+ settings = &p->repo->settings;
+
+ window_align = settings->packed_git_window_size / 2;
if (p->pack_fd == -1 && open_packed_git(p))
die("packfile %s cannot be accessed", p->pack_name);
@@ -657,11 +666,12 @@ unsigned char *use_pack(struct packed_git *p,
CALLOC_ARRAY(win, 1);
win->offset = (offset / window_align) * window_align;
len = p->pack_size - win->offset;
- if (len > packed_git_window_size)
- len = packed_git_window_size;
+ if (len > settings->packed_git_window_size)
+ len = settings->packed_git_window_size;
win->len = (size_t)len;
pack_mapped += win->len;
- while (packed_git_limit < pack_mapped
+
+ while (settings->packed_git_limit < pack_mapped
&& unuse_one_window(p))
; /* nothing */
win->base = xmmap_gently(NULL, win->len,
@@ -703,11 +713,13 @@ void unuse_pack(struct pack_window **w_cursor)
}
}
-struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
+struct packed_git *add_packed_git(struct repository *r, const char *path,
+ size_t path_len, int local)
{
struct stat st;
size_t alloc;
struct packed_git *p;
+ struct object_id oid;
/*
* Make sure a corresponding .pack file exists and that
@@ -721,7 +733,7 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
* the use xsnprintf double-checks that)
*/
alloc = st_add3(path_len, strlen(".promisor"), 1);
- p = alloc_packed_git(alloc);
+ p = alloc_packed_git(r, alloc);
memcpy(p->pack_name, path, path_len);
xsnprintf(p->pack_name + path_len, alloc - path_len, ".keep");
@@ -748,9 +760,13 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
p->pack_size = st.st_size;
p->pack_local = local;
p->mtime = st.st_mtime;
- if (path_len < the_hash_algo->hexsz ||
- get_hash_hex(path + path_len - the_hash_algo->hexsz, p->hash))
- hashclr(p->hash, the_repository->hash_algo);
+ if (path_len < r->hash_algo->hexsz ||
+ get_oid_hex_algop(path + path_len - r->hash_algo->hexsz, &oid,
+ r->hash_algo))
+ hashclr(p->hash, r->hash_algo);
+ else
+ hashcpy(p->hash, oid.hash, r->hash_algo);
+
return p;
}
@@ -877,7 +893,7 @@ static void prepare_pack(const char *full_name, size_t full_name_len,
/* Don't reopen a pack we already have. */
if (!hashmap_get(&data->r->objects->pack_map, &hent, pack_name)) {
- p = add_packed_git(full_name, full_name_len, data->local);
+ p = add_packed_git(data->r, full_name, full_name_len, data->local);
if (p)
install_packed_git(data->r, p);
}
@@ -1240,9 +1256,9 @@ off_t get_delta_base(struct packed_git *p,
} else if (type == OBJ_REF_DELTA) {
/* The base entry _must_ be in the same pack */
struct object_id oid;
- oidread(&oid, base_info, the_repository->hash_algo);
+ oidread(&oid, base_info, p->repo->hash_algo);
base_offset = find_pack_entry_one(&oid, p);
- *curpos += the_hash_algo->rawsz;
+ *curpos += p->repo->hash_algo->rawsz;
} else
die("I am totally screwed");
return base_offset;
@@ -1263,7 +1279,7 @@ static int get_delta_base_oid(struct packed_git *p,
{
if (type == OBJ_REF_DELTA) {
unsigned char *base = use_pack(p, w_curs, curpos, NULL);
- oidread(oid, base, the_repository->hash_algo);
+ oidread(oid, base, p->repo->hash_algo);
return 0;
} else if (type == OBJ_OFS_DELTA) {
uint32_t base_pos;
@@ -1488,7 +1504,9 @@ void clear_delta_base_cache(void)
}
static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
- void *base, unsigned long base_size, enum object_type type)
+ void *base, unsigned long base_size,
+ unsigned long delta_base_cache_limit,
+ enum object_type type)
{
struct delta_base_cache_entry *ent;
struct list_head *lru, *tmp;
@@ -1605,7 +1623,7 @@ int packed_object_info(struct repository *r, struct packed_git *p,
goto out;
}
} else
- oidclr(oi->delta_base_oid, the_repository->hash_algo);
+ oidclr(oi->delta_base_oid, p->repo->hash_algo);
}
oi->whence = in_delta_base_cache(p, obj_offset) ? OI_DBCACHED :
@@ -1690,6 +1708,8 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
int delta_stack_nr = 0, delta_stack_alloc = UNPACK_ENTRY_STACK_PREALLOC;
int base_from_cache = 0;
+ prepare_repo_settings(p->repo);
+
write_pack_access_log(p, obj_offset);
/* PHASE 1: drill down to the innermost base object */
@@ -1870,7 +1890,9 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
* before we are done using it.
*/
if (!external_base)
- add_delta_base_cache(p, base_obj_offset, base, base_size, type);
+ add_delta_base_cache(p, base_obj_offset, base, base_size,
+ p->repo->settings.delta_base_cache_limit,
+ type);
free(delta_data);
free(external_base);
@@ -1894,7 +1916,7 @@ int bsearch_pack(const struct object_id *oid, const struct packed_git *p, uint32
{
const unsigned char *index_fanout = p->index_data;
const unsigned char *index_lookup;
- const unsigned int hashsz = the_hash_algo->rawsz;
+ const unsigned int hashsz = p->repo->hash_algo->rawsz;
int index_lookup_width;
if (!index_fanout)
@@ -1919,7 +1941,7 @@ int nth_packed_object_id(struct object_id *oid,
uint32_t n)
{
const unsigned char *index = p->index_data;
- const unsigned int hashsz = the_hash_algo->rawsz;
+ const unsigned int hashsz = p->repo->hash_algo->rawsz;
if (!index) {
if (open_pack_index(p))
return -1;
@@ -1930,11 +1952,10 @@ int nth_packed_object_id(struct object_id *oid,
index += 4 * 256;
if (p->index_version == 1) {
oidread(oid, index + st_add(st_mult(hashsz + 4, n), 4),
- the_repository->hash_algo);
+ p->repo->hash_algo);
} else {
index += 8;
- oidread(oid, index + st_mult(hashsz, n),
- the_repository->hash_algo);
+ oidread(oid, index + st_mult(hashsz, n), p->repo->hash_algo);
}
return 0;
}
@@ -1956,7 +1977,7 @@ void check_pack_index_ptr(const struct packed_git *p, const void *vptr)
off_t nth_packed_object_offset(const struct packed_git *p, uint32_t n)
{
const unsigned char *index = p->index_data;
- const unsigned int hashsz = the_hash_algo->rawsz;
+ const unsigned int hashsz = p->repo->hash_algo->rawsz;
index += 4 * 256;
if (p->index_version == 1) {
return ntohl(*((uint32_t *)(index + st_mult(hashsz + 4, n))));
@@ -2136,16 +2157,17 @@ int find_kept_pack_entry(struct repository *r,
return 0;
}
-int has_object_pack(const struct object_id *oid)
+int has_object_pack(struct repository *r, const struct object_id *oid)
{
struct pack_entry e;
- return find_pack_entry(the_repository, oid, &e);
+ return find_pack_entry(r, oid, &e);
}
-int has_object_kept_pack(const struct object_id *oid, unsigned flags)
+int has_object_kept_pack(struct repository *r, const struct object_id *oid,
+ unsigned flags)
{
struct pack_entry e;
- return find_kept_pack_entry(the_repository, oid, flags, &e);
+ return find_kept_pack_entry(r, oid, flags, &e);
}
int for_each_object_in_pack(struct packed_git *p,
@@ -2156,7 +2178,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(the_repository, p))
+ if (load_pack_revindex(p->repo, p))
return -1;
}
@@ -2192,15 +2214,14 @@ int for_each_object_in_pack(struct packed_git *p,
return r;
}
-int for_each_packed_object(each_packed_object_fn cb, void *data,
- enum for_each_object_flags flags)
+int for_each_packed_object(struct repository *repo, each_packed_object_fn cb,
+ void *data, enum for_each_object_flags flags)
{
struct packed_git *p;
int r = 0;
int pack_errors = 0;
- prepare_packed_git(the_repository);
- for (p = get_all_packs(the_repository); p; p = p->next) {
+ for (p = get_all_packs(repo); p; p = p->next) {
if ((flags & FOR_EACH_OBJECT_LOCAL_ONLY) && !p->pack_local)
continue;
if ((flags & FOR_EACH_OBJECT_PROMISOR_ONLY) &&
@@ -2224,7 +2245,7 @@ int for_each_packed_object(each_packed_object_fn cb, void *data,
}
static int add_promisor_object(const struct object_id *oid,
- struct packed_git *pack UNUSED,
+ struct packed_git *pack,
uint32_t pos UNUSED,
void *set_)
{
@@ -2232,12 +2253,12 @@ static int add_promisor_object(const struct object_id *oid,
struct object *obj;
int we_parsed_object;
- obj = lookup_object(the_repository, oid);
+ obj = lookup_object(pack->repo, oid);
if (obj && obj->parsed) {
we_parsed_object = 0;
} else {
we_parsed_object = 1;
- obj = parse_object(the_repository, oid);
+ obj = parse_object(pack->repo, oid);
}
if (!obj)
@@ -2278,14 +2299,14 @@ static int add_promisor_object(const struct object_id *oid,
return 0;
}
-int is_promisor_object(const struct object_id *oid)
+int is_promisor_object(struct repository *r, const struct object_id *oid)
{
static struct oidset promisor_objects;
static int promisor_objects_prepared;
if (!promisor_objects_prepared) {
- if (repo_has_promisor_remote(the_repository)) {
- for_each_packed_object(add_promisor_object,
+ if (repo_has_promisor_remote(r)) {
+ for_each_packed_object(r, add_promisor_object,
&promisor_objects,
FOR_EACH_OBJECT_PROMISOR_ONLY |
FOR_EACH_OBJECT_PACK_ORDER);
@@ -2294,3 +2315,23 @@ int is_promisor_object(const struct object_id *oid)
}
return oidset_contains(&promisor_objects, oid);
}
+
+int parse_pack_header_option(const char *in, unsigned char *out, unsigned int *len)
+{
+ unsigned char *hdr;
+ char *c;
+
+ hdr = out;
+ put_be32(hdr, PACK_SIGNATURE);
+ hdr += 4;
+ put_be32(hdr, strtoul(in, &c, 10));
+ hdr += 4;
+ if (*c != ',')
+ return -1;
+ put_be32(hdr, strtoul(c + 1, &c, 10));
+ hdr += 4;
+ if (*c)
+ return -1;
+ *len = hdr - out;
+ return 0;
+}
diff --git a/packfile.h b/packfile.h
index 08f88a7ff5..00ada7a938 100644
--- a/packfile.h
+++ b/packfile.h
@@ -29,7 +29,8 @@ struct pack_entry {
*
* Example: odb_pack_name(out, sha1, "idx") => ".git/objects/pack/pack-1234..idx"
*/
-char *odb_pack_name(struct strbuf *buf, const unsigned char *sha1, const char *ext);
+char *odb_pack_name(struct repository *r, struct strbuf *buf,
+ const unsigned char *hash, const char *ext);
/*
* Return the basename of the packfile, omitting any containing directory
@@ -46,7 +47,8 @@ const char *pack_basename(struct packed_git *p);
* and does not add the resulting packed_git struct to the internal list of
* packs. You probably want add_packed_git() instead.
*/
-struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
+struct packed_git *parse_pack_index(struct repository *r, unsigned char *sha1,
+ const char *idx_path);
typedef void each_file_in_pack_dir_fn(const char *full_path, size_t full_path_len,
const char *file_name, void *data);
@@ -87,7 +89,7 @@ unsigned long repo_approximate_object_count(struct repository *r);
struct packed_git *find_oid_pack(const struct object_id *oid,
struct packed_git *packs);
-void pack_report(void);
+void pack_report(struct repository *repo);
/*
* mmap the index file for the specified packfile (if it is not
@@ -113,7 +115,8 @@ void close_pack(struct packed_git *);
void close_object_store(struct raw_object_store *o);
void unuse_pack(struct pack_window **);
void clear_delta_base_cache(void);
-struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
+struct packed_git *add_packed_git(struct repository *r, const char *path,
+ size_t path_len, int local);
/*
* Unlink the .pack and associated extension files.
@@ -190,14 +193,15 @@ const struct packed_git *has_packed_and_bad(struct repository *, const struct ob
int find_pack_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e);
int find_kept_pack_entry(struct repository *r, const struct object_id *oid, unsigned flags, struct pack_entry *e);
-int has_object_pack(const struct object_id *oid);
-int has_object_kept_pack(const struct object_id *oid, unsigned flags);
+int has_object_pack(struct repository *r, const struct object_id *oid);
+int has_object_kept_pack(struct repository *r, const struct object_id *oid,
+ unsigned flags);
/*
* Return 1 if an object in a promisor packfile is or refers to the given
* object, 0 otherwise.
*/
-int is_promisor_object(const struct object_id *oid);
+int is_promisor_object(struct repository *r, const struct object_id *oid);
/*
* Expose a function for fuzz testing.
@@ -212,4 +216,10 @@ int is_promisor_object(const struct object_id *oid);
int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
size_t idx_size, struct packed_git *p);
+/*
+ * Parse a --pack_header option as accepted by index-pack and unpack-objects,
+ * turning it into the matching bytes we'd find in a pack.
+ */
+int parse_pack_header_option(const char *in, unsigned char *out, unsigned int *len);
+
#endif
diff --git a/pager.c b/pager.c
index 40b664f893..5531fff50e 100644
--- a/pager.c
+++ b/pager.c
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "git-compat-util.h"
#include "config.h"
#include "editor.h"
@@ -84,7 +82,7 @@ static int core_pager_config(const char *var, const char *value,
return 0;
}
-const char *git_pager(int stdout_is_tty)
+const char *git_pager(struct repository *r, int stdout_is_tty)
{
const char *pager;
@@ -94,7 +92,7 @@ const char *git_pager(int stdout_is_tty)
pager = getenv("GIT_PAGER");
if (!pager) {
if (!pager_program)
- read_early_config(the_repository,
+ read_early_config(r,
core_pager_config, NULL);
pager = pager_program;
}
@@ -143,10 +141,10 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
pager_process->trace2_child_class = "pager";
}
-void setup_pager(void)
+void setup_pager(struct repository *r)
{
static int once = 0;
- const char *pager = git_pager(isatty(1));
+ const char *pager = git_pager(r, isatty(1));
if (!pager)
return;
@@ -293,7 +291,7 @@ static int pager_command_config(const char *var, const char *value,
}
/* returns 0 for "no pager", 1 for "use pager", and -1 for "not specified" */
-int check_pager_config(const char *cmd)
+int check_pager_config(struct repository *r, const char *cmd)
{
struct pager_command_config_data data;
@@ -301,7 +299,7 @@ int check_pager_config(const char *cmd)
data.want = -1;
data.value = NULL;
- read_early_config(the_repository, pager_command_config, &data);
+ read_early_config(r, pager_command_config, &data);
if (data.value)
pager_program = data.value;
diff --git a/pager.h b/pager.h
index 103ecac476..d070be6348 100644
--- a/pager.h
+++ b/pager.h
@@ -2,15 +2,16 @@
#define PAGER_H
struct child_process;
+struct repository;
-const char *git_pager(int stdout_is_tty);
-void setup_pager(void);
+const char *git_pager(struct repository *r, int stdout_is_tty);
+void setup_pager(struct repository *r);
void wait_for_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);
+int check_pager_config(struct repository *r, const char *cmd);
void prepare_pager_args(struct child_process *, const char *pager);
extern int pager_use_color;
diff --git a/parallel-checkout.c b/parallel-checkout.c
index 01736f1352..7cc6b30528 100644
--- a/parallel-checkout.c
+++ b/parallel-checkout.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/parse-options.c b/parse-options.c
index 33bfba0ed4..35fbb3b0d6 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -1076,11 +1076,48 @@ static int usage_argh(const struct option *opts, FILE *outfile)
!opts->argh || !!strpbrk(opts->argh, "()<>[]|");
if (opts->flags & PARSE_OPT_OPTARG)
if (opts->long_name)
- s = literal ? "[=%s]" : "[=<%s>]";
+ /*
+ * TRANSLATORS: The "<%s>" part of this string
+ * stands for an optional value given to a command
+ * line option in the long form, and "<>" is there
+ * as a convention to signal that it is a
+ * placeholder (i.e. the user should substitute it
+ * with the real value). If your language uses a
+ * different convention, you can change "<%s>" part
+ * to match yours, e.g. it might use "|%s|" instead,
+ * or if the alphabet is different enough it may use
+ * "%s" without any placeholder signal. Most
+ * translations leave this message as is.
+ */
+ s = literal ? "[=%s]" : _("[=<%s>]");
else
- s = literal ? "[%s]" : "[<%s>]";
+ /*
+ * TRANSLATORS: The "<%s>" part of this string
+ * stands for an optional value given to a command
+ * line option in the short form, and "<>" is there
+ * as a convention to signal that it is a
+ * placeholder (i.e. the user should substitute it
+ * with the real value). If your language uses a
+ * different convention, you can change "<%s>" part
+ * to match yours, e.g. it might use "|%s|" instead,
+ * or if the alphabet is different enough it may use
+ * "%s" without any placeholder signal. Most
+ * translations leave this message as is.
+ */
+ s = literal ? "[%s]" : _("[<%s>]");
else
- s = literal ? " %s" : " <%s>";
+ /*
+ * TRANSLATORS: The "<%s>" part of this string stands for a
+ * value given to a command line option, and "<>" is there
+ * as a convention to signal that it is a placeholder
+ * (i.e. the user should substitute it with the real value).
+ * If your language uses a different convention, you can
+ * change "<%s>" part to match yours, e.g. it might use
+ * "|%s|" instead, or if the alphabet is different enough it
+ * may use "%s" without any placeholder signal. Most
+ * translations leave this message as is.
+ */
+ s = literal ? " %s" : _(" <%s>");
return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _("..."));
}
@@ -1282,6 +1319,16 @@ void NORETURN usage_with_options(const char * const *usagestr,
exit(129);
}
+void show_usage_with_options_if_asked(int ac, const char **av,
+ const char * const *usagestr,
+ const struct option *opts)
+{
+ if (ac == 2 && !strcmp(av[1], "-h")) {
+ usage_with_options_internal(NULL, usagestr, opts, 0, 0);
+ exit(129);
+ }
+}
+
void NORETURN usage_msg_opt(const char *msg,
const char * const *usagestr,
const struct option *options)
diff --git a/parse-options.h b/parse-options.h
index f0801d4532..39f0886254 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -353,6 +353,18 @@ struct option {
.callback = parse_opt_noop_cb, \
}
+static char *parse_options_noop_ignored_value MAYBE_UNUSED;
+#define OPT_NOOP_ARG(s, l) { \
+ .type = OPTION_CALLBACK, \
+ .short_name = (s), \
+ .long_name = (l), \
+ .value = &parse_options_noop_ignored_value, \
+ .argh = "ignored", \
+ .help = N_("no-op (backward compatibility)"), \
+ .flags = PARSE_OPT_HIDDEN, \
+ .callback = parse_opt_noop_cb, \
+}
+
#define OPT_ALIAS(s, l, source_long_name) { \
.type = OPTION_ALIAS, \
.short_name = (s), \
@@ -390,6 +402,10 @@ int parse_options(int argc, const char **argv, const char *prefix,
NORETURN void usage_with_options(const char * const *usagestr,
const struct option *options);
+void show_usage_with_options_if_asked(int ac, const char **av,
+ const char * const *usage,
+ const struct option *options);
+
NORETURN void usage_msg_opt(const char *msg,
const char * const *usagestr,
const struct option *options);
diff --git a/path-walk.c b/path-walk.c
new file mode 100644
index 0000000000..9715a5550e
--- /dev/null
+++ b/path-walk.c
@@ -0,0 +1,591 @@
+/*
+ * path-walk.c: implementation for path-based walks of the object graph.
+ */
+#include "git-compat-util.h"
+#include "path-walk.h"
+#include "blob.h"
+#include "commit.h"
+#include "dir.h"
+#include "hashmap.h"
+#include "hex.h"
+#include "list-objects.h"
+#include "object.h"
+#include "oid-array.h"
+#include "prio-queue.h"
+#include "revision.h"
+#include "string-list.h"
+#include "strmap.h"
+#include "tag.h"
+#include "trace2.h"
+#include "tree.h"
+#include "tree-walk.h"
+
+static const char *root_path = "";
+
+struct type_and_oid_list {
+ enum object_type type;
+ struct oid_array oids;
+ int maybe_interesting;
+};
+
+#define TYPE_AND_OID_LIST_INIT { \
+ .type = OBJ_NONE, \
+ .oids = OID_ARRAY_INIT \
+}
+
+struct path_walk_context {
+ /**
+ * Repeats of data in 'struct path_walk_info' for
+ * access with fewer characters.
+ */
+ struct repository *repo;
+ struct rev_info *revs;
+ struct path_walk_info *info;
+
+ /**
+ * Map a path to a 'struct type_and_oid_list'
+ * containing the objects discovered at that
+ * path.
+ */
+ struct strmap paths_to_lists;
+
+ /**
+ * Store the current list of paths in a priority queue,
+ * using object type as a sorting mechanism, mostly to
+ * make sure blobs are popped off the stack first. No
+ * other sort is made, so within each object type it acts
+ * like a stack and performs a DFS within the trees.
+ *
+ * Use path_stack_pushed to indicate whether a path
+ * was previously added to path_stack.
+ */
+ struct prio_queue path_stack;
+ struct strset path_stack_pushed;
+};
+
+static int compare_by_type(const void *one, const void *two, void *cb_data)
+{
+ struct type_and_oid_list *list1, *list2;
+ const char *str1 = one;
+ const char *str2 = two;
+ struct path_walk_context *ctx = cb_data;
+
+ list1 = strmap_get(&ctx->paths_to_lists, str1);
+ list2 = strmap_get(&ctx->paths_to_lists, str2);
+
+ /*
+ * If object types are equal, then use path comparison.
+ */
+ if (!list1 || !list2 || list1->type == list2->type)
+ return strcmp(str1, str2);
+
+ /* Prefer tags to be popped off first. */
+ if (list1->type == OBJ_TAG)
+ return -1;
+ if (list2->type == OBJ_TAG)
+ return 1;
+
+ /* Prefer blobs to be popped off second. */
+ if (list1->type == OBJ_BLOB)
+ return -1;
+ if (list2->type == OBJ_BLOB)
+ return 1;
+
+ return 0;
+}
+
+static void push_to_stack(struct path_walk_context *ctx,
+ const char *path)
+{
+ if (strset_contains(&ctx->path_stack_pushed, path))
+ return;
+
+ strset_add(&ctx->path_stack_pushed, path);
+ prio_queue_put(&ctx->path_stack, xstrdup(path));
+}
+
+static int add_tree_entries(struct path_walk_context *ctx,
+ const char *base_path,
+ struct object_id *oid)
+{
+ struct tree_desc desc;
+ struct name_entry entry;
+ struct strbuf path = STRBUF_INIT;
+ size_t base_len;
+ struct tree *tree = lookup_tree(ctx->repo, oid);
+
+ if (!tree) {
+ error(_("failed to walk children of tree %s: not found"),
+ oid_to_hex(oid));
+ return -1;
+ } else if (parse_tree_gently(tree, 1)) {
+ error("bad tree object %s", oid_to_hex(oid));
+ return -1;
+ }
+
+ strbuf_addstr(&path, base_path);
+ base_len = path.len;
+
+ init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size);
+ while (tree_entry(&desc, &entry)) {
+ struct type_and_oid_list *list;
+ struct object *o;
+ /* Not actually true, but we will ignore submodules later. */
+ enum object_type type = S_ISDIR(entry.mode) ? OBJ_TREE : OBJ_BLOB;
+
+ /* Skip submodules. */
+ if (S_ISGITLINK(entry.mode))
+ continue;
+
+ /* If the caller doesn't want blobs, then don't bother. */
+ if (!ctx->info->blobs && type == OBJ_BLOB)
+ continue;
+
+ if (type == OBJ_TREE) {
+ struct tree *child = lookup_tree(ctx->repo, &entry.oid);
+ o = child ? &child->object : NULL;
+ } else if (type == OBJ_BLOB) {
+ struct blob *child = lookup_blob(ctx->repo, &entry.oid);
+ o = child ? &child->object : NULL;
+ } else {
+ BUG("invalid type for tree entry: %d", type);
+ }
+
+ if (!o) {
+ error(_("failed to find object %s"),
+ oid_to_hex(&o->oid));
+ return -1;
+ }
+
+ /* Skip this object if already seen. */
+ if (o->flags & SEEN)
+ continue;
+ o->flags |= SEEN;
+
+ strbuf_setlen(&path, base_len);
+ strbuf_add(&path, entry.path, entry.pathlen);
+
+ /*
+ * Trees will end with "/" for concatenation and distinction
+ * from blobs at the same path.
+ */
+ if (type == OBJ_TREE)
+ strbuf_addch(&path, '/');
+
+ if (!(list = strmap_get(&ctx->paths_to_lists, path.buf))) {
+ CALLOC_ARRAY(list, 1);
+ list->type = type;
+ strmap_put(&ctx->paths_to_lists, path.buf, list);
+ }
+ push_to_stack(ctx, path.buf);
+
+ if (!(o->flags & UNINTERESTING))
+ list->maybe_interesting = 1;
+
+ oid_array_append(&list->oids, &entry.oid);
+ }
+
+ free_tree_buffer(tree);
+ strbuf_release(&path);
+ return 0;
+}
+
+/*
+ * For each path in paths_to_explore, walk the trees another level
+ * and add any found blobs to the batch (but only if they exist and
+ * haven't been added yet).
+ */
+static int walk_path(struct path_walk_context *ctx,
+ const char *path)
+{
+ struct type_and_oid_list *list;
+ int ret = 0;
+
+ list = strmap_get(&ctx->paths_to_lists, path);
+
+ if (!list)
+ BUG("provided path '%s' that had no associated list", path);
+
+ if (!list->oids.nr)
+ return 0;
+
+ if (ctx->info->prune_all_uninteresting) {
+ /*
+ * This is true if all objects were UNINTERESTING
+ * when added to the list.
+ */
+ if (!list->maybe_interesting)
+ return 0;
+
+ /*
+ * But it's still possible that the objects were set
+ * as UNINTERESTING after being added. Do a quick check.
+ */
+ list->maybe_interesting = 0;
+ for (size_t i = 0;
+ !list->maybe_interesting && i < list->oids.nr;
+ i++) {
+ if (list->type == OBJ_TREE) {
+ struct tree *t = lookup_tree(ctx->repo,
+ &list->oids.oid[i]);
+ if (t && !(t->object.flags & UNINTERESTING))
+ list->maybe_interesting = 1;
+ } else if (list->type == OBJ_BLOB) {
+ struct blob *b = lookup_blob(ctx->repo,
+ &list->oids.oid[i]);
+ if (b && !(b->object.flags & UNINTERESTING))
+ list->maybe_interesting = 1;
+ } else {
+ /* Tags are always interesting if visited. */
+ list->maybe_interesting = 1;
+ }
+ }
+
+ /* We have confirmed that all objects are UNINTERESTING. */
+ if (!list->maybe_interesting)
+ return 0;
+ }
+
+ /* Evaluate function pointer on this data, if requested. */
+ if ((list->type == OBJ_TREE && ctx->info->trees) ||
+ (list->type == OBJ_BLOB && ctx->info->blobs) ||
+ (list->type == OBJ_TAG && ctx->info->tags))
+ ret = ctx->info->path_fn(path, &list->oids, list->type,
+ ctx->info->path_fn_data);
+
+ /* Expand data for children. */
+ if (list->type == OBJ_TREE) {
+ for (size_t i = 0; i < list->oids.nr; i++) {
+ ret |= add_tree_entries(ctx,
+ path,
+ &list->oids.oid[i]);
+ }
+ }
+
+ oid_array_clear(&list->oids);
+ strmap_remove(&ctx->paths_to_lists, path, 1);
+ return ret;
+}
+
+static void clear_paths_to_lists(struct strmap *map)
+{
+ struct hashmap_iter iter;
+ struct strmap_entry *e;
+
+ hashmap_for_each_entry(&map->map, &iter, e, ent) {
+ struct type_and_oid_list *list = e->value;
+ oid_array_clear(&list->oids);
+ }
+ strmap_clear(map, 1);
+ strmap_init(map);
+}
+
+static struct repository *edge_repo;
+static struct type_and_oid_list *edge_tree_list;
+
+static void show_edge(struct commit *commit)
+{
+ struct tree *t = repo_get_commit_tree(edge_repo, commit);
+
+ if (!t)
+ return;
+
+ if (commit->object.flags & UNINTERESTING)
+ t->object.flags |= UNINTERESTING;
+
+ if (t->object.flags & SEEN)
+ return;
+ t->object.flags |= SEEN;
+
+ oid_array_append(&edge_tree_list->oids, &t->object.oid);
+}
+
+static int setup_pending_objects(struct path_walk_info *info,
+ struct path_walk_context *ctx)
+{
+ struct type_and_oid_list *tags = NULL;
+ struct type_and_oid_list *tagged_blobs = NULL;
+ struct type_and_oid_list *root_tree_list = NULL;
+
+ if (info->tags)
+ CALLOC_ARRAY(tags, 1);
+ if (info->blobs)
+ CALLOC_ARRAY(tagged_blobs, 1);
+ if (info->trees)
+ root_tree_list = strmap_get(&ctx->paths_to_lists, root_path);
+
+ /*
+ * Pending objects include:
+ * * Commits at branch tips.
+ * * Annotated tags at tag tips.
+ * * Any kind of object at lightweight tag tips.
+ * * Trees and blobs in the index (with an associated path).
+ */
+ for (size_t i = 0; i < info->revs->pending.nr; i++) {
+ struct object_array_entry *pending = info->revs->pending.objects + i;
+ struct object *obj = pending->item;
+
+ /* Commits will be picked up by revision walk. */
+ if (obj->type == OBJ_COMMIT)
+ continue;
+
+ /* Navigate annotated tag object chains. */
+ while (obj->type == OBJ_TAG) {
+ struct tag *tag = lookup_tag(info->revs->repo, &obj->oid);
+ if (!tag) {
+ error(_("failed to find tag %s"),
+ oid_to_hex(&obj->oid));
+ return -1;
+ }
+ if (tag->object.flags & SEEN)
+ break;
+ tag->object.flags |= SEEN;
+
+ if (tags)
+ oid_array_append(&tags->oids, &obj->oid);
+ obj = tag->tagged;
+ }
+
+ if (obj->type == OBJ_TAG)
+ continue;
+
+ /* We are now at a non-tag object. */
+ if (obj->flags & SEEN)
+ continue;
+ obj->flags |= SEEN;
+
+ switch (obj->type) {
+ case OBJ_TREE:
+ if (!info->trees)
+ continue;
+ if (pending->path) {
+ struct type_and_oid_list *list;
+ char *path = *pending->path ? xstrfmt("%s/", pending->path)
+ : xstrdup("");
+ if (!(list = strmap_get(&ctx->paths_to_lists, path))) {
+ CALLOC_ARRAY(list, 1);
+ list->type = OBJ_TREE;
+ strmap_put(&ctx->paths_to_lists, path, list);
+ }
+ oid_array_append(&list->oids, &obj->oid);
+ free(path);
+ } else {
+ /* assume a root tree, such as a lightweight tag. */
+ oid_array_append(&root_tree_list->oids, &obj->oid);
+ }
+ break;
+
+ case OBJ_BLOB:
+ if (!info->blobs)
+ continue;
+ if (pending->path) {
+ struct type_and_oid_list *list;
+ char *path = pending->path;
+ if (!(list = strmap_get(&ctx->paths_to_lists, path))) {
+ CALLOC_ARRAY(list, 1);
+ list->type = OBJ_BLOB;
+ strmap_put(&ctx->paths_to_lists, path, list);
+ }
+ oid_array_append(&list->oids, &obj->oid);
+ } else {
+ /* assume a root tree, such as a lightweight tag. */
+ oid_array_append(&tagged_blobs->oids, &obj->oid);
+ }
+ break;
+
+ case OBJ_COMMIT:
+ /* Make sure it is in the object walk */
+ if (obj != pending->item)
+ add_pending_object(info->revs, obj, "");
+ break;
+
+ default:
+ BUG("should not see any other type here");
+ }
+ }
+
+ /*
+ * Add tag objects and tagged blobs if they exist.
+ */
+ if (tagged_blobs) {
+ if (tagged_blobs->oids.nr) {
+ const char *tagged_blob_path = "/tagged-blobs";
+ tagged_blobs->type = OBJ_BLOB;
+ tagged_blobs->maybe_interesting = 1;
+ strmap_put(&ctx->paths_to_lists, tagged_blob_path, tagged_blobs);
+ push_to_stack(ctx, tagged_blob_path);
+ } else {
+ oid_array_clear(&tagged_blobs->oids);
+ free(tagged_blobs);
+ }
+ }
+ if (tags) {
+ if (tags->oids.nr) {
+ const char *tag_path = "/tags";
+ tags->type = OBJ_TAG;
+ tags->maybe_interesting = 1;
+ strmap_put(&ctx->paths_to_lists, tag_path, tags);
+ push_to_stack(ctx, tag_path);
+ } else {
+ oid_array_clear(&tags->oids);
+ free(tags);
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * Given the configuration of 'info', walk the commits based on 'info->revs' and
+ * call 'info->path_fn' on each discovered path.
+ *
+ * Returns nonzero on an error.
+ */
+int walk_objects_by_path(struct path_walk_info *info)
+{
+ int ret;
+ size_t commits_nr = 0, paths_nr = 0;
+ struct commit *c;
+ struct type_and_oid_list *root_tree_list;
+ struct type_and_oid_list *commit_list;
+ struct path_walk_context ctx = {
+ .repo = info->revs->repo,
+ .revs = info->revs,
+ .info = info,
+ .path_stack = {
+ .compare = compare_by_type,
+ .cb_data = &ctx
+ },
+ .path_stack_pushed = STRSET_INIT,
+ .paths_to_lists = STRMAP_INIT
+ };
+
+ trace2_region_enter("path-walk", "commit-walk", info->revs->repo);
+
+ CALLOC_ARRAY(commit_list, 1);
+ commit_list->type = OBJ_COMMIT;
+
+ if (info->tags)
+ info->revs->tag_objects = 1;
+
+ /* Insert a single list for the root tree into the paths. */
+ CALLOC_ARRAY(root_tree_list, 1);
+ root_tree_list->type = OBJ_TREE;
+ root_tree_list->maybe_interesting = 1;
+ strmap_put(&ctx.paths_to_lists, root_path, root_tree_list);
+ push_to_stack(&ctx, root_path);
+
+ /*
+ * Set these values before preparing the walk to catch
+ * lightweight tags pointing to non-commits and indexed objects.
+ */
+ info->revs->blob_objects = info->blobs;
+ info->revs->tree_objects = info->trees;
+
+ if (prepare_revision_walk(info->revs))
+ die(_("failed to setup revision walk"));
+
+ /* Walk trees to mark them as UNINTERESTING. */
+ edge_repo = info->revs->repo;
+ edge_tree_list = root_tree_list;
+ mark_edges_uninteresting(info->revs, show_edge,
+ info->prune_all_uninteresting);
+ edge_repo = NULL;
+ edge_tree_list = NULL;
+
+ info->revs->blob_objects = info->revs->tree_objects = 0;
+
+ trace2_region_enter("path-walk", "pending-walk", info->revs->repo);
+ ret = setup_pending_objects(info, &ctx);
+ trace2_region_leave("path-walk", "pending-walk", info->revs->repo);
+
+ if (ret)
+ return ret;
+
+ while ((c = get_revision(info->revs))) {
+ struct object_id *oid;
+ struct tree *t;
+ commits_nr++;
+
+ if (info->commits)
+ oid_array_append(&commit_list->oids,
+ &c->object.oid);
+
+ /* If we only care about commits, then skip trees. */
+ if (!info->trees && !info->blobs)
+ continue;
+
+ oid = get_commit_tree_oid(c);
+ t = lookup_tree(info->revs->repo, oid);
+
+ if (!t) {
+ error("could not find tree %s", oid_to_hex(oid));
+ return -1;
+ }
+
+ if (t->object.flags & SEEN)
+ continue;
+ t->object.flags |= SEEN;
+ oid_array_append(&root_tree_list->oids, oid);
+ }
+
+ trace2_data_intmax("path-walk", ctx.repo, "commits", commits_nr);
+ trace2_region_leave("path-walk", "commit-walk", info->revs->repo);
+
+ /* Track all commits. */
+ if (info->commits && commit_list->oids.nr)
+ ret = info->path_fn("", &commit_list->oids, OBJ_COMMIT,
+ info->path_fn_data);
+ oid_array_clear(&commit_list->oids);
+ free(commit_list);
+
+ trace2_region_enter("path-walk", "path-walk", info->revs->repo);
+ while (!ret && ctx.path_stack.nr) {
+ char *path = prio_queue_get(&ctx.path_stack);
+ paths_nr++;
+
+ ret = walk_path(&ctx, path);
+
+ free(path);
+ }
+
+ /* Are there paths remaining? Likely they are from indexed objects. */
+ if (!strmap_empty(&ctx.paths_to_lists)) {
+ struct hashmap_iter iter;
+ struct strmap_entry *entry;
+
+ strmap_for_each_entry(&ctx.paths_to_lists, &iter, entry)
+ push_to_stack(&ctx, entry->key);
+
+ while (!ret && ctx.path_stack.nr) {
+ char *path = prio_queue_get(&ctx.path_stack);
+ paths_nr++;
+
+ ret = walk_path(&ctx, path);
+
+ free(path);
+ }
+ }
+
+ trace2_data_intmax("path-walk", ctx.repo, "paths", paths_nr);
+ trace2_region_leave("path-walk", "path-walk", info->revs->repo);
+
+ clear_paths_to_lists(&ctx.paths_to_lists);
+ strset_clear(&ctx.path_stack_pushed);
+ clear_prio_queue(&ctx.path_stack);
+ return ret;
+}
+
+void path_walk_info_init(struct path_walk_info *info)
+{
+ struct path_walk_info empty = PATH_WALK_INFO_INIT;
+ memcpy(info, &empty, sizeof(empty));
+}
+
+void path_walk_info_clear(struct path_walk_info *info UNUSED)
+{
+ /*
+ * This destructor is empty for now, as info->revs
+ * is not owned by 'struct path_walk_info'.
+ */
+}
diff --git a/path-walk.h b/path-walk.h
new file mode 100644
index 0000000000..414d6db23c
--- /dev/null
+++ b/path-walk.h
@@ -0,0 +1,69 @@
+/*
+ * path-walk.h : Methods and structures for walking the object graph in batches
+ * by the paths that can reach those objects.
+ */
+#include "object.h" /* Required for 'enum object_type'. */
+
+struct rev_info;
+struct oid_array;
+
+/**
+ * The type of a function pointer for the method that is called on a list of
+ * objects reachable at a given path.
+ */
+typedef int (*path_fn)(const char *path,
+ struct oid_array *oids,
+ enum object_type type,
+ void *data);
+
+struct path_walk_info {
+ /**
+ * revs provides the definitions for the commit walk, including
+ * which commits are UNINTERESTING or not. This structure is
+ * expected to be owned by the caller.
+ */
+ struct rev_info *revs;
+
+ /**
+ * The caller wishes to execute custom logic on objects reachable at a
+ * given path. Every reachable object will be visited exactly once, and
+ * the first path to see an object wins. This may not be a stable choice.
+ */
+ path_fn path_fn;
+ void *path_fn_data;
+
+ /**
+ * Initialize which object types the path_fn should be called on. This
+ * could also limit the walk to skip blobs if not set.
+ */
+ int commits;
+ int trees;
+ int blobs;
+ int tags;
+
+ /**
+ * When 'prune_all_uninteresting' is set and a path has all objects
+ * marked as UNINTERESTING, then the path-walk will not visit those
+ * objects. It will not call path_fn on those objects and will not
+ * walk the children of such trees.
+ */
+ int prune_all_uninteresting;
+};
+
+#define PATH_WALK_INFO_INIT { \
+ .blobs = 1, \
+ .trees = 1, \
+ .commits = 1, \
+ .tags = 1, \
+}
+
+void path_walk_info_init(struct path_walk_info *info);
+void path_walk_info_clear(struct path_walk_info *info);
+
+/**
+ * Given the configuration of 'info', walk the commits based on 'info->revs' and
+ * call 'info->path_fn' on each discovered path.
+ *
+ * Returns nonzero on an error.
+ */
+int walk_objects_by_path(struct path_walk_info *info);
diff --git a/path.c b/path.c
index 93491bab14..07964f5d32 100644
--- a/path.c
+++ b/path.c
@@ -684,7 +684,7 @@ return_null:
* links. User relative paths are also returned as they are given,
* except DWIM suffixing.
*/
-const char *enter_repo(const char *path, int strict)
+const char *enter_repo(const char *path, unsigned flags)
{
static struct strbuf validated_path = STRBUF_INIT;
static struct strbuf used_path = STRBUF_INIT;
@@ -692,7 +692,7 @@ const char *enter_repo(const char *path, int strict)
if (!path)
return NULL;
- if (!strict) {
+ if (!(flags & ENTER_REPO_STRICT)) {
static const char *suffix[] = {
"/.git", "", ".git/.git", ".git", NULL,
};
@@ -736,7 +736,8 @@ const char *enter_repo(const char *path, int strict)
if (!suffix[i])
return NULL;
gitfile = read_gitfile(used_path.buf);
- die_upon_dubious_ownership(gitfile, NULL, used_path.buf);
+ if (!(flags & ENTER_REPO_ANY_OWNER_OK))
+ die_upon_dubious_ownership(gitfile, NULL, used_path.buf);
if (gitfile) {
strbuf_reset(&used_path);
strbuf_addstr(&used_path, gitfile);
@@ -747,7 +748,8 @@ const char *enter_repo(const char *path, int strict)
}
else {
const char *gitfile = read_gitfile(path);
- die_upon_dubious_ownership(gitfile, NULL, path);
+ if (!(flags & ENTER_REPO_ANY_OWNER_OK))
+ die_upon_dubious_ownership(gitfile, NULL, path);
if (gitfile)
path = gitfile;
if (chdir(path))
@@ -1140,12 +1142,12 @@ int strbuf_normalize_path(struct strbuf *src)
*/
int longest_ancestor_length(const char *path, struct string_list *prefixes)
{
- int i, max_len = -1;
+ int max_len = -1;
if (!strcmp(path, "/"))
return -1;
- for (i = 0; i < prefixes->nr; i++) {
+ for (size_t i = 0; i < prefixes->nr; i++) {
const char *ceil = prefixes->items[i].string;
int len = strlen(ceil);
diff --git a/path.h b/path.h
index e91d19fff6..5f6c85e5f8 100644
--- a/path.h
+++ b/path.h
@@ -156,7 +156,22 @@ int calc_shared_perm(int mode);
int adjust_shared_perm(const char *path);
char *interpolate_path(const char *path, int real_home);
-const char *enter_repo(const char *path, int strict);
+
+/* The bits are as follows:
+ *
+ * - ENTER_REPO_STRICT: callers that require exact paths (as opposed
+ * to allowing known suffixes like ".git", ".git/.git" to be
+ * omitted) can set this bit.
+ *
+ * - ENTER_REPO_ANY_OWNER_OK: callers that are willing to run without
+ * ownership check can set this bit.
+ */
+enum {
+ ENTER_REPO_STRICT = (1<<0),
+ ENTER_REPO_ANY_OWNER_OK = (1<<1),
+};
+
+const char *enter_repo(const char *path, unsigned flags);
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);
diff --git a/pathspec.c b/pathspec.c
index 0fc6f84a6e..89663645e1 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
diff --git a/perl/FromCPAN/Mail/meson.build b/perl/FromCPAN/Mail/meson.build
new file mode 100644
index 0000000000..b4ff2fc0b2
--- /dev/null
+++ b/perl/FromCPAN/Mail/meson.build
@@ -0,0 +1,8 @@
+test_dependencies += custom_target(
+ input: 'Address.pm',
+ output: 'Address.pm',
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/FromCPAN/Mail',
+ depends: [git_version_file],
+)
diff --git a/perl/FromCPAN/meson.build b/perl/FromCPAN/meson.build
new file mode 100644
index 0000000000..1f9ea6ce8e
--- /dev/null
+++ b/perl/FromCPAN/meson.build
@@ -0,0 +1,10 @@
+test_dependencies += custom_target(
+ input: 'Error.pm',
+ output: 'Error.pm',
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/FromCPAN',
+ depends: [git_version_file],
+)
+
+subdir('Mail')
diff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm
index ab46edb608..162230af81 100644
--- a/perl/Git/I18N.pm
+++ b/perl/Git/I18N.pm
@@ -20,14 +20,14 @@ our @EXPORT_OK = @EXPORT;
# this "'@@' [...] '@@'" pattern.
use constant NO_GETTEXT_STR => '@@' . 'NO_GETTEXT' . '@@';
use constant NO_GETTEXT => (
- q[@@NO_GETTEXT@@] ne ''
+ q[@NO_GETTEXT@] ne ''
and
- q[@@NO_GETTEXT@@] ne NO_GETTEXT_STR
+ q[@NO_GETTEXT@] ne NO_GETTEXT_STR
);
sub __bootstrap_locale_messages {
our $TEXTDOMAIN = 'git';
- our $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '@@LOCALEDIR@@';
+ our $TEXTDOMAINDIR ||= $ENV{GIT_TEXTDOMAINDIR} || '@LOCALEDIR@';
die "NO_GETTEXT=" . NO_GETTEXT_STR if NO_GETTEXT;
require POSIX;
diff --git a/perl/Git/LoadCPAN.pm b/perl/Git/LoadCPAN.pm
index 61254fddbb..92d63c71d2 100644
--- a/perl/Git/LoadCPAN.pm
+++ b/perl/Git/LoadCPAN.pm
@@ -31,11 +31,11 @@ C<git.git> repository. Use it for anything else at your peril!
# Makefile, and allows for detecting whether the module is loaded from
# perl/Git as opposed to perl/build/Git, which is useful for one-off
# testing without having Error.pm et al installed.
-use constant NO_PERL_CPAN_FALLBACKS_STR => '@@' . 'NO_PERL_CPAN_FALLBACKS' . '@@';
+use constant NO_PERL_CPAN_FALLBACKS_STR => '@' . 'NO_PERL_CPAN_FALLBACKS' . '@';
use constant NO_PERL_CPAN_FALLBACKS => (
- q[@@NO_PERL_CPAN_FALLBACKS@@] ne ''
+ q[@NO_PERL_CPAN_FALLBACKS@] ne ''
and
- q[@@NO_PERL_CPAN_FALLBACKS@@] ne NO_PERL_CPAN_FALLBACKS_STR
+ q[@NO_PERL_CPAN_FALLBACKS@] ne NO_PERL_CPAN_FALLBACKS_STR
);
sub import {
diff --git a/perl/Git/LoadCPAN/Mail/meson.build b/perl/Git/LoadCPAN/Mail/meson.build
new file mode 100644
index 0000000000..89cde56be8
--- /dev/null
+++ b/perl/Git/LoadCPAN/Mail/meson.build
@@ -0,0 +1,8 @@
+test_dependencies += custom_target(
+ input: 'Address.pm',
+ output: 'Address.pm',
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN/Mail',
+ depends: [git_version_file],
+)
diff --git a/perl/Git/LoadCPAN/meson.build b/perl/Git/LoadCPAN/meson.build
new file mode 100644
index 0000000000..1ee915c650
--- /dev/null
+++ b/perl/Git/LoadCPAN/meson.build
@@ -0,0 +1,10 @@
+test_dependencies += custom_target(
+ input: 'Error.pm',
+ output: 'Error.pm',
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN',
+ depends: [git_version_file],
+)
+
+subdir('Mail')
diff --git a/perl/Git/SVN/Memoize/meson.build b/perl/Git/SVN/Memoize/meson.build
new file mode 100644
index 0000000000..233ec670d7
--- /dev/null
+++ b/perl/Git/SVN/Memoize/meson.build
@@ -0,0 +1,8 @@
+test_dependencies += custom_target(
+ input: 'YAML.pm',
+ output: 'YAML.pm',
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/Git/SVN',
+ depends: [git_version_file],
+)
diff --git a/perl/Git/SVN/meson.build b/perl/Git/SVN/meson.build
new file mode 100644
index 0000000000..44abaf42b7
--- /dev/null
+++ b/perl/Git/SVN/meson.build
@@ -0,0 +1,21 @@
+foreach source : [
+ 'Editor.pm',
+ 'Fetcher.pm',
+ 'GlobSpec.pm',
+ 'Log.pm',
+ 'Migration.pm',
+ 'Prompt.pm',
+ 'Ra.pm',
+ 'Utils.pm',
+]
+ test_dependencies += custom_target(
+ input: source,
+ output: source,
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/Git/SVN',
+ depends: [git_version_file],
+ )
+endforeach
+
+subdir('Memoize')
diff --git a/perl/Git/meson.build b/perl/Git/meson.build
new file mode 100644
index 0000000000..b21fa5591e
--- /dev/null
+++ b/perl/Git/meson.build
@@ -0,0 +1,19 @@
+foreach source : [
+ 'I18N.pm',
+ 'IndexInfo.pm',
+ 'LoadCPAN.pm',
+ 'Packet.pm',
+ 'SVN.pm',
+]
+ test_dependencies += custom_target(
+ input: source,
+ output: source,
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5/Git',
+ depends: [git_version_file],
+ )
+endforeach
+
+subdir('LoadCPAN')
+subdir('SVN')
diff --git a/perl/header_templates/fixed_prefix.template.pl b/perl/header_templates/fixed_prefix.template.pl
index 857b4391a4..d571ca5cde 100644
--- a/perl/header_templates/fixed_prefix.template.pl
+++ b/perl/header_templates/fixed_prefix.template.pl
@@ -1 +1 @@
-use lib (split(/@@PATHSEP@@/, $ENV{GITPERLLIB} || '@@INSTLIBDIR@@'));
+use lib (split(/@PATHSEP@/, $ENV{GITPERLLIB} || '@INSTLIBDIR@'));
diff --git a/perl/header_templates/runtime_prefix.template.pl b/perl/header_templates/runtime_prefix.template.pl
index 9d28b3d863..e6f8e661a1 100644
--- a/perl/header_templates/runtime_prefix.template.pl
+++ b/perl/header_templates/runtime_prefix.template.pl
@@ -3,7 +3,7 @@
# This finds our Git::* libraries relative to the script's runtime path.
sub __git_system_path {
my ($relpath) = @_;
- my $gitexecdir_relative = '@@GITEXECDIR_REL@@';
+ my $gitexecdir_relative = '@GITEXECDIR_REL@';
# GIT_EXEC_PATH is supplied by `git` or the test suite.
my $exec_path;
@@ -24,11 +24,11 @@ sub __git_system_path {
}
BEGIN {
- use lib split /@@PATHSEP@@/,
+ use lib split /@PATHSEP@/,
(
$ENV{GITPERLLIB} ||
do {
- my $perllibdir = __git_system_path('@@PERLLIBDIR_REL@@');
+ my $perllibdir = __git_system_path('@PERLLIBDIR_REL@');
(-e $perllibdir) || die("Invalid system path ($relpath): $path");
$perllibdir;
}
@@ -36,7 +36,7 @@ BEGIN {
# Export the system locale directory to the I18N module. The locale directory
# is only installed if NO_GETTEXT is set.
- $Git::I18N::TEXTDOMAINDIR = __git_system_path('@@LOCALEDIR_REL@@');
+ $Git::I18N::TEXTDOMAINDIR = __git_system_path('@LOCALEDIR_REL@');
}
# END RUNTIME_PREFIX generated code.
diff --git a/perl/meson.build b/perl/meson.build
new file mode 100644
index 0000000000..2d4ab1c4a9
--- /dev/null
+++ b/perl/meson.build
@@ -0,0 +1,13 @@
+test_dependencies += custom_target(
+ input: 'Git.pm',
+ output: 'Git.pm',
+ command: generate_perl_command,
+ install: true,
+ install_dir: get_option('datadir') / 'perl5',
+ depends: [git_version_file],
+)
+
+subdir('Git')
+if get_option('perl_cpan_fallback')
+ subdir('FromCPAN')
+endif
diff --git a/pkt-line.c b/pkt-line.c
index 24479eae4d..a5bcbc96fb 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -39,7 +39,6 @@ static int packet_trace_pack(const char *buf, unsigned int len, int sideband)
static void packet_trace(const char *buf, unsigned int len, int write)
{
- int i;
struct strbuf out;
static int in_pack, sideband;
@@ -72,7 +71,7 @@ static void packet_trace(const char *buf, unsigned int len, int write)
get_trace_prefix(), write ? '>' : '<');
/* XXX we should really handle printable utf8 */
- for (i = 0; i < len; i++) {
+ for (unsigned int i = 0; i < len; i++) {
/* suppress newlines */
if (buf[i] == '\n')
continue;
@@ -338,30 +337,32 @@ int write_packetized_from_buf_no_flush_count(const char *src_in, size_t len,
}
static int get_packet_data(int fd, char **src_buf, size_t *src_size,
- void *dst, unsigned size, int options)
+ void *dst, size_t size, int options)
{
- ssize_t ret;
+ size_t bytes_read;
if (fd >= 0 && src_buf && *src_buf)
BUG("multiple sources given to packet_read");
/* Read up to "size" bytes from our source, whatever it is. */
if (src_buf && *src_buf) {
- ret = size < *src_size ? size : *src_size;
- memcpy(dst, *src_buf, ret);
- *src_buf += ret;
- *src_size -= ret;
+ bytes_read = size < *src_size ? size : *src_size;
+ memcpy(dst, *src_buf, bytes_read);
+ *src_buf += bytes_read;
+ *src_size -= bytes_read;
} else {
- ret = read_in_full(fd, dst, size);
+ ssize_t ret = read_in_full(fd, dst, size);
if (ret < 0) {
if (options & PACKET_READ_GENTLE_ON_READ_ERROR)
return error_errno(_("read error"));
die_errno(_("read error"));
}
+
+ bytes_read = (size_t) ret;
}
/* And complain if we didn't get enough bytes to satisfy the read. */
- if (ret != size) {
+ if (bytes_read != size) {
if (options & PACKET_READ_GENTLE_ON_EOF)
return -1;
@@ -370,7 +371,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,
die(_("the remote end hung up unexpectedly"));
}
- return ret;
+ return 0;
}
int packet_length(const char lenbuf_hex[4], size_t size)
diff --git a/po/bg.po b/po/bg.po
index 1f7222dd93..2fc6c2b60c 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -225,6 +225,14 @@
# mailmap файл за съответствията на имената и адресите на е-поща
# unit test поединичен тест
# test suite група тестове
+# object database базата от данни за обектите
+# expecting integer изисква се число
+# timeout максимално изчакване
+# init timeout максимално първоначално изчакване
+# implies option включва опцията
+# cache-tree кеша на обектите-дървета
+# acquire lock придобивам ключалка
+# detached отделѐн, несвързан
#
# ------------------------
# „$var“ - може да не сработва за shell има gettext и eval_gettext - проверка - намират се лесно по „$
@@ -251,10 +259,10 @@
# 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.45\n"
+"Project-Id-Version: git 2.48\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2024-10-05 01:20+0000\n"
-"PO-Revision-Date: 2024-10-05 13:20+0200\n"
+"POT-Creation-Date: 2024-12-27 22:37+0100\n"
+"PO-Revision-Date: 2024-12-27 22:40+0100\n"
"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
"Language: bg\n"
@@ -564,8 +572,8 @@ msgstr ""
#, c-format
msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Премахване на промяната в права̀та за достъп от работното дърво [y,n,q,a,"
-"d%s,?]? "
+"Премахване на промяната в права̀та за достъп от работното дърво "
+"[y,n,q,a,d%s,?]? "
#, c-format
msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
@@ -605,8 +613,8 @@ msgstr ""
#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Премахване на промяната в права̀та за достъп от индекса и работното дърво [y,"
-"n,q,a,d%s,?]? "
+"Премахване на промяната в права̀та за достъп от индекса и работното дърво "
+"[y,n,q,a,d%s,?]? "
#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
@@ -641,8 +649,8 @@ msgstr ""
#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Прилагане на промяната в права̀та за достъп от индекса и работното дърво [y,n,"
-"q,a,d%s,?]? "
+"Прилагане на промяната в права̀та за достъп от индекса и работното дърво "
+"[y,n,q,a,d%s,?]? "
#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
@@ -676,8 +684,8 @@ msgstr ""
#, c-format
msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Прилагане на промяната в права̀та за достъп към работното дърво [y,n,q,a,"
-"d%s,?]? "
+"Прилагане на промяната в права̀та за достъп към работното дърво "
+"[y,n,q,a,d%s,?]? "
#, c-format
msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
@@ -893,12 +901,12 @@ msgstr "Променени са само двоични файлове."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
"За да изключите това предупреждение, изпълнете:\n"
"\n"
-" git config advice.%s false"
+" git config set advice.%s false"
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -1016,8 +1024,8 @@ msgstr ""
"\n"
" git switch -\n"
"\n"
-"Може да спрете това съобщение със задаване на настройката „advice."
-"detachedHead“\n"
+"Може да спрете това съобщение със задаване на настройката "
+"„advice.detachedHead“\n"
"да е „false“ (лъжа̀).\n"
#, c-format
@@ -1247,7 +1255,7 @@ msgstr "двоичната кръпка не може да се приложи �
#, c-format
msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
msgstr ""
-"двоичната кръпка за „%s“ води до неправилни резултати (очакваше се: „%s“, а "
+"двоичната кръпка за „%s“ води до неправилни резултати (изисква се: „%s“, а "
"бе получено: „%s“)"
#, c-format
@@ -2651,9 +2659,9 @@ 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] [ЛОШО [ДОБРО…]] "
-"[--] [ПЪТ…]"
+"git bisect start [--term-(new,bad)=УПРАВЛЯВАЩА_ДУМА --term-"
+"(old,good)=УПРАВЛЯВАЩА_ДУМА] [--no-checkout] [--first-parent] [ЛОШО "
+"[ДОБРО…]] [--] [ПЪТ…]"
msgid "git bisect (good|bad) [<rev>...]"
msgstr "git bisect (good|bad) [ВЕРСИЯ…]"
@@ -2936,7 +2944,7 @@ msgstr "ОПЦИИте_ЗА_ВЕРСИЯТА са документирани в
#, c-format
msgid "expecting a color: %s"
-msgstr "трябва да е цвят: %s"
+msgstr "изисква се цвят: %s"
msgid "must end with a color"
msgstr "трябва да завършва с цвят"
@@ -3349,8 +3357,8 @@ msgid "HEAD not found below refs/heads!"
msgstr "В директорията „refs/heads“ липсва файл „HEAD“"
msgid ""
-"branch with --recurse-submodules can only be used if submodule."
-"propagateBranches is enabled"
+"branch with --recurse-submodules can only be used if "
+"submodule.propagateBranches is enabled"
msgstr ""
"може да се ползва клон с опцията „--recurse-submodules“, само ако "
"настройката „submodule.propagateBranches“ е зададена"
@@ -3653,8 +3661,8 @@ msgstr "позволяване на опциите „-s“ и „-t“ да р�
msgid "use mail map file"
msgstr ""
-"използване на файл за съответствията на имената и адресите на е-поща („."
-"mailmap“)"
+"използване на файл за съответствията на имената и адресите на е-поща "
+"(„.mailmap“)"
msgid "Batch objects requested on stdin (or --batch-all-objects)"
msgstr ""
@@ -4206,7 +4214,7 @@ msgstr ""
"„zdiff3“)"
msgid "detach HEAD at named commit"
-msgstr "отделяне на указателя „HEAD“ към указаното подаване"
+msgstr "отделяне на указателя „HEAD“ при указаното подаване"
msgid "force checkout (throw away local modifications)"
msgstr "принудително изтегляне (вашите промѐни ще бъдат занулени)"
@@ -4220,8 +4228,8 @@ msgstr "нов неродѐн клон"
msgid "update ignored files (default)"
msgstr "обновяване на игнорираните файлове (стандартно)"
-msgid "do not check if another worktree is holding the given ref"
-msgstr "без проверка дали друго работно дърво държи указателя"
+msgid "do not check if another worktree is using this branch"
+msgstr "без проверка дали друго работно дърво ползва този клон"
msgid "checkout our version for unmerged files"
msgstr "изтегляне на вашата версия на неслетите файлове"
@@ -4525,10 +4533,10 @@ msgstr "плитко клониране до тази ДЪЛБОЧИНА"
msgid "create a shallow clone since a specific time"
msgstr "плитко клониране до момент във времето"
-msgid "revision"
-msgstr "ВЕРСИЯ"
+msgid "ref"
+msgstr "УКАЗ"
-msgid "deepen history of shallow clone, excluding rev"
+msgid "deepen history of shallow clone, excluding ref"
msgstr "задълбочаване на историята на плитко хранилище до изключващ указател"
msgid "clone only one branch, HEAD or --branch"
@@ -5509,9 +5517,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
-"git config unset [ОПЦИЯ_ЗА_ФАЙЛ] [--all] [--value=СТОЙНОСТ] [--fixed-value]"
+"git config unset [ОПЦИЯ_ЗА_ФАЙЛ] [--all] [--value=СТОЙНОСТ] [--fixed-value] "
+"ИМЕ"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr "git config rename-section [ОПЦИЯ_ЗА_ФАЙЛ] СТАРО_ИМЕ НОВО_ИМЕ"
@@ -5963,12 +5972,8 @@ msgid "traversed %lu commits\n"
msgstr "обходени са %lu подавания\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"открити са над %i етикета, изведени са последните %i,\n"
-"търсенето бе прекратено при „%s“.\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "открити са %i етикета. Търсенето приключи при „%s“\n"
#, c-format
msgid "describe %s\n"
@@ -6414,6 +6419,27 @@ msgstr "„%s“ е неправилен обект"
msgid "the object %s does not exist"
msgstr "обектът „%s“ не съществува"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Изпълнете\n"
+"\n"
+" git remote set-head %s %s\n"
+"\n"
+"за да следвате промяната или задайте друга стойност на настройката\n"
+"„remote.%s.followRemoteHEAD, ако не искате тези съобщения.\n"
+"Изпълнението на\n"
+"\n"
+" git config set remote.%s.followRemoteHEAD %s\n"
+"\n"
+"ще изключи предупреждението, докато отдалеченият указател HEAD не\n"
+"започне да сочи нещо друго."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr ""
"засечени са множество клони, това е несъвместимо с опцията „--set-upstream“"
@@ -6553,6 +6579,9 @@ msgstr "КАРТА_С_УКАЗАТЕЛИ"
msgid "specify fetch refmap"
msgstr "указване на КАРТАта_С_УКАЗАТЕЛИ за доставяне"
+msgid "revision"
+msgstr "ВЕРСИЯ"
+
msgid "report that we have only objects reachable from this object"
msgstr "докладване, че всички обекти може са достижими при започване от този"
@@ -6608,8 +6637,8 @@ msgid "protocol does not support --negotiate-only, exiting"
msgstr "протоколът не поддържа опцията „--negotiate-only“, изход от програмата"
msgid ""
-"--filter can only be used with the remote configured in extensions."
-"partialclone"
+"--filter can only be used with the remote configured in "
+"extensions.partialclone"
msgstr ""
"опцията „--filter“ може да се ползва само с отдалеченото хранилище указано в "
"настройката „extensions.partialclone“"
@@ -6859,7 +6888,7 @@ msgstr "„%s“ сочи към нещо необичайно (%s)"
#, c-format
msgid "%s: detached HEAD points at nothing"
-msgstr "%s: несвързаният връх „HEAD“ не сочи към нищо"
+msgstr "%s: отделеният връх „HEAD“ не сочи към нищо"
#, c-format
msgid "notice: %s points to an unborn branch (%s)"
@@ -7169,8 +7198,8 @@ msgstr "неуспешно изпълнение на „git multi-pack-index rep
msgid ""
"skipping incremental-repack task because core.multiPackIndex is disabled"
msgstr ""
-"задачата „incremental-repack“ се прескача, защото настройката „core."
-"multiPackIndex“ е изключена"
+"задачата „incremental-repack“ се прескача, защото настройката "
+"„core.multiPackIndex“ е изключена"
#, c-format
msgid "lock file '%s' exists, skipping maintenance"
@@ -7291,8 +7320,25 @@ msgstr "липсват както таймери на systemd, така и cront
msgid "%s scheduler is not available"
msgstr "планиращият модул „%s“ липсва"
-msgid "another process is scheduling background maintenance"
-msgstr "друг процес задава поддръжката на заден фон"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"Файлът-ключалка „%s.lock“ не може да бъде създаден: %s\n"
+"\n"
+"Изглежда, че и друг процес на git-maintenance(1) е пуснат в това\n"
+"хранилище. Уверете се, че всички подобни процеси са спрени и опитайте\n"
+"отново. Ако това не помогне, вероятната причина е, че някой процес на\n"
+"git-maintenance(1) в това хранилище е забил. За да продължите работа,\n"
+"ще трябва ръчно да изтриете файла:"
+
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "не може да се придобие ключалката за поддръжката на заден фон"
msgid "git maintenance start [--scheduler=<scheduler>]"
msgstr "git maintenance start [--scheduler=ПЛАНИРАЩ_МОДУЛ]"
@@ -7876,6 +7922,24 @@ msgid_plural "chain length = %d: %lu objects"
msgstr[0] "дължината на веригата е %d: %lu обект"
msgstr[1] "дължината на веригата е %d: %lu обекта"
+msgid "could not start pack-objects to repack local links"
+msgstr ""
+"командата „pack-objects“ не може да се стартира за препакетирането на "
+"локалните връзки"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "локалните обекти не може да се подадат на командата „pack-objects“"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: от „pack-objects“ се изискват редове само с пълни шестнайсетични "
+"указатели."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr ""
+"командата „pack-objects“ не може да завърши за препакетирането на локалните "
+"връзки"
+
msgid "Cannot come back to cwd"
msgstr "Процесът не може да се върне към предишната работна директория"
@@ -7887,6 +7951,9 @@ msgstr "неправилна стойност „%s“"
msgid "unknown hash algorithm '%s'"
msgstr "непознат алгоритъм за контролни суми „%s“"
+msgid "--promisor cannot be used with a pack name"
+msgstr "опцията „--promisor“ е несъвместима с име на пакет"
+
msgid "--stdin requires a git repository"
msgstr "„--stdin“ изисква хранилище на git"
@@ -9283,11 +9350,14 @@ msgstr "git notes [--ref УКАЗАТЕЛ_ЗА_БЕЛЕЖКА] [list [ОБЕКТ
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
+"| -C) <object>] [<object>] [-e]\n"
"git notes [--ref УКАЗАТЕЛ_ЗА_БЕЛЕЖКА] add [-f] [--allow-empty] [--"
"[no-]separator|--separator=<paragraph-break>] [--[no-]stripspace] [-m "
-"СЪОБЩЕНИЕ|-F ФАЙЛ|(-c|-C) ОБЕКТ] [ОБЕКТ]"
+"СЪОБЩЕНИЕ|-F ФАЙЛ|(-c|-C) ОБЕКТ] [ОБЕКТ] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
@@ -9296,11 +9366,11 @@ msgstr ""
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref УКАЗАТЕЛ_ЗА_БЕЛЕЖКА] append [--allow-empty] [--"
"[no-]separator|--separator=КРАЙ_НА_АБЗАЦ] [--[no-]stripspace] [-m СЪОБЩЕНИЕ "
-"| -F ФАЙЛ|(-c|-C) ОБЕКТ] [ОБЕКТ]"
+"| -F ФАЙЛ|(-c|-C) ОБЕКТ] [ОБЕКТ] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref УКАЗАТЕЛ_ЗА_БЕЛЕЖКА] edit [--allow-empty] [ОБЕКТ]"
@@ -9422,6 +9492,9 @@ msgstr "ФАЙЛ със съдържанието на бележката"
msgid "reuse and edit specified note object"
msgstr "преизползване и редактиране на указания ОБЕКТ-бележка"
+msgid "edit note message in editor"
+msgstr "редактиране на съобщението в редактора"
+
msgid "reuse specified note object"
msgstr "преизползване на указания ОБЕКТ-бележка"
@@ -9660,7 +9733,7 @@ msgstr "неуспешно записване на индекси на база
#, c-format
msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
-msgstr "бяха записани %<PRIu32> обекти, а се очакваха %<PRIu32>"
+msgstr "бяха записани %<PRIu32> обекти, а се изискват %<PRIu32>"
msgid "disabling bitmap writing, as some objects are not being packed"
msgstr ""
@@ -9940,6 +10013,9 @@ msgstr "как да се обработват липсващите обекти"
msgid "do not pack objects in promisor packfiles"
msgstr "без пакетиране на обекти в гарантиращи пакети"
+msgid "implies --missing=allow-any"
+msgstr "включва опцията „--missing=allow-any“"
+
msgid "respect islands during delta compression"
msgstr "без промяна на групите при делта компресия"
@@ -10315,7 +10391,7 @@ msgid ""
" git push %s HEAD:<name-of-remote-branch>\n"
msgstr ""
"В момента не сте на никой клон. За да изтласкате историята до състоянието,\n"
-"сочено в момента от указателя „HEAD“, използвайте командата:\n"
+"сочено в момента от (несвързания) указател „HEAD“, използвайте командата:\n"
"\n"
" git push %s HEAD:ИМЕ_НА_ОТДАЛЕЧЕНИЯ_КЛОН\n"
@@ -11592,6 +11668,30 @@ msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " Локалният указател, настроен за „git push“%s:"
msgstr[1] " Локалните указатели, настроени за „git push“%s:"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "„%s/HEAD“ не е променен и сочи към „%s“\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "„%s/HEAD“ е променен от „%s“ и сега сочи към „%s“\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "„%s/HEAD“ е създаден и сочи към „%s“\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "„%s/HEAD“ е отделѐн при „%s“ и сочи към „%s“\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"„%s/HEAD“ сочеше към „%s“ (което не е отдалечен клон), но сега сочи към "
+"„%s“\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "задаване на refs/remotes/ИМЕ/HEAD според отдалеченото хранилище"
@@ -11614,7 +11714,7 @@ msgid "Not a valid ref: %s"
msgstr "Неправилен указател: %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "„%s“ не може да се настрои"
#, c-format
@@ -12287,8 +12387,8 @@ msgstr ""
" или: git rev-parse --sq-quote [АРГУМЕНТ…]\n"
" или: git rev-parse [ОПЦИЯ…] [АРГУМЕНТ…]\n"
"\n"
-"За повече информация за първия вариант изпълнете „git rev-parse --parseopt -"
-"h“"
+"За повече информация за първия вариант изпълнете „git rev-parse --parseopt "
+"-h“"
msgid "--resolve-git-dir requires an argument"
msgstr "опцията „--resolve-git-dir“ изисква аргумент"
@@ -13119,7 +13219,7 @@ msgstr "добавяне на „# “ в началото на всеки ре�
#, c-format
msgid "Expecting a full ref name, got %s"
-msgstr "Очаква се пълно име на указател, а не „%s“"
+msgstr "Изисква се пълно име на указател, а не „%s“"
#, c-format
msgid "could not get a repository handle for submodule '%s'"
@@ -13546,7 +13646,8 @@ msgid "don't print cloning progress"
msgstr "без извеждане на напредъка на клонирането"
msgid "disallow cloning into non-empty directory, implies --init"
-msgstr "предотвратяване на клониране в непразна история, включва „--init“"
+msgstr ""
+"предотвратяване на клониране в непразна история, включва опцията „--init“"
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
@@ -14403,6 +14504,9 @@ msgstr "задаване на режима на следене (виж git-branc
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "опит за напасване на името на новия клон с това на следящ клон"
+msgid "use relative paths for worktrees"
+msgstr "използване на относителни пътища за работните дървета"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "опциите „%s“, „%s“ и „%s“ са несъвместими"
@@ -14684,6 +14788,26 @@ msgstr "файлът „%s“ не може да бъде създаден"
msgid "index-pack died"
msgstr "командата „git index-pack“ не завърши успешно"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "директорията „%s“ е в индекса, но не е частична"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "повреденият кеш на обектите-дървета съдържа записи извън индекса"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "„%s“ с флагове 0x%x не трябва да е в кеша на обектите-дървета"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "неправилно поддърво „%.*s“"
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr ""
+"кешираният обект-дърво за пътя „%.*s“ не съвпада. Изисква се „%s“, а не „%s“"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "идентификаторът за краен откъс се явява по-рано от очакваното"
@@ -15468,7 +15592,7 @@ msgstr "временният файл на гра̀фа с подаваният�
#, c-format
msgid "cannot merge graphs with %<PRIuMAX>, %<PRIuMAX> commits"
msgstr ""
-"не може да се слеят графове с %<PRIuMAX> и %<PRIuMAX> подавания (съответно)"
+"не може да се слеят гра̀фи с %<PRIuMAX> и %<PRIuMAX> подавания (съответно)"
#, c-format
msgid "cannot merge graph %s, too many commits: %<PRIuMAX>"
@@ -15490,8 +15614,8 @@ msgid ""
"attempting to write a commit-graph, but 'commitGraph.changedPathsVersion' "
"(%d) is not supported"
msgstr ""
-"опит за запис на гра̀фа с подаванията, но настройката „commitGraph."
-"changedPathsVersion“ (%d) не се поддържа"
+"опит за запис на гра̀фа с подаванията, но настройката "
+"„commitGraph.changedPathsVersion“ (%d) не се поддържа"
msgid "too many commits to write graph"
msgstr "прекалено много подавания за записване на гра̀фа"
@@ -15578,7 +15702,7 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Поддръжката на „<GIT_DIR>/info/grafts“ е остаряла.\n"
"В бъдеща версия на Git ще бъде премахната.\n"
@@ -15590,7 +15714,7 @@ msgstr ""
"\n"
"За да изключите това съобщение, изпълнете:\n"
"\n"
-" git config advice.graftFileDeprecated false"
+" git config set advice.graftFileDeprecated false"
#, c-format
msgid "commit %s exists in commit-graph but not in the object database"
@@ -16445,6 +16569,24 @@ msgstr "адресът е без схема: %s"
msgid "credential url cannot be parsed: %s"
msgstr "адресът за идентификация не може да се анализира: „%s“"
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr ""
+"неправилна стойност за „timeout“ (максимално изчакване) „%s“, изисква се "
+"неотрицателно цяло число"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr ""
+"неправилна стойност за „init-timeout“ (максимално първоначално изчакване): "
+"„%s“, изисква се неотрицателно цяло число"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr ""
+"неправилна стойност за „max-connections“ (максималния брой връзки): „%s“, "
+"изисква се цяло число"
+
msgid "in the future"
msgstr "в бъдещето"
@@ -17170,6 +17312,22 @@ msgstr "неправилен път към пространства от име�
msgid "too many args to run %s"
msgstr "прекалено много аргументи за изпълнение „%s“"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Пробвате да доставите „%s“, което е в гра̀фа с подаванията, но не и в базата "
+"от данни за обектите.\n"
+"Най-вероятната причина е повредено хранилище.\n"
+"За да поправите хранилището като изтеглите липсващия обект наново, "
+"изпълнете:\n"
+"\n"
+" git fetch --refetch"
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: очаква се плитък списък"
@@ -17770,11 +17928,12 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
"Куката „%s“ се прескача, защото липсват права̀ за изпълнение.\n"
"За да изключите това предупреждение, изпълнете:\n"
-" git config advice.ignoredHook false"
+"\n"
+" git config set advice.ignoredHook false"
msgid "not a git repository"
msgstr "не е хранилище на Git"
@@ -17791,15 +17950,9 @@ msgstr ""
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Управлението на делегирането не се поддържа от cURL < 7.22.0"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "Задаването на постоянен публичен ключ не се поддържа от cURL < 7.39.0"
-
msgid "Unknown value for http.proactiveauth"
msgstr "Непозната стойност за „http.proactiveauth“"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "„CURLSSLOPT_NO_REVOKE“ не се поддържа от cURL < 7.44.0"
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "Неподдържана реализация на SSL „%s“. Поддържат се:"
@@ -17992,6 +18145,10 @@ msgid "unable to format message: %s"
msgstr "съобщението не може да се форматира: %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "неправилен размер на маркер: „%s“, изисква се цяло число"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Неуспешно сливане на подмодула „%s“ (не е изтеглен)"
@@ -19147,7 +19304,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"При нормална работа Git никога не създава указатели, които завършват\n"
"с 40 шестнадесетични знака, защото стандартно те ще бъдат прескачани.\n"
@@ -19159,7 +19316,7 @@ msgstr ""
"се създава подобен указател. Прегледайте тези указатели и ги изтрийте.\n"
"За да изключите това съобщение, изпълнете:\n"
"\n"
-" git config advice.objectNameWarning false"
+" config set advice.objectNameWarning false"
#, c-format
msgid "log for '%.*s' only goes back to %s"
@@ -19330,15 +19487,6 @@ msgstr "задължителният обратен индекс липсва в
msgid "could not open pack %s"
msgstr "пакетът „%s“ не може да се отвори"
-msgid "could not determine MIDX preferred pack"
-msgstr ""
-"предпочитаният пакет за файла с индекса за множество пакети не може да се "
-"определи"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "предпочитаният пакет „%s“ е неправилен"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr ""
"повредена таблица със съответствия: местоположението на тройката е извън "
@@ -20497,20 +20645,28 @@ msgstr "журналът с подаванията за указателя „%s
msgid "log for %s is empty"
msgstr "журналът с подаванията за указателя „%s“ е празен"
-msgid "refusing to force and skip creation of reflog"
-msgstr ""
-"принудителна операция без създаване на журнал на указателите няма да се "
-"приеме"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "указател не може да се обнови с грешно име „%s“"
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "журналът на указателите няма да се обнови с псевдо указателя „%s“"
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "псевдо указателят „%s“ няма да се обнови"
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "журналът на указателите няма да се обнови с грешно име „%s“"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "указател не може да се обнови с грешно име „%s“"
+
+msgid "refusing to force and skip creation of reflog"
+msgstr ""
+"принудителна операция без създаване на журнал на указателите няма да се "
+"приеме"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "неуспешно обновяване на указателя (update_ref) „%s“: %s"
@@ -20560,6 +20716,10 @@ msgstr ""
"„%s“, но вместо това е обикновен указател"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "файлът с указател „%s“ не може да се прочете"
+
+#, c-format
msgid "cannot open directory %s"
msgstr "директорията „%s“ не може да бъде отворена"
@@ -20781,6 +20941,10 @@ msgid "more than one uploadpack given, using the first"
msgstr "зададен е повече от един пакет за изпращане, ще се ползва първият"
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "непознатата стойност за „followRemoteHEAD“: „%s“, се прескача"
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "непозната стойност за „transfer.credentialsInUrl“: „%s“"
@@ -22788,6 +22952,11 @@ msgstr "подаването „%s“ не е отбелязано като до
msgid "too many commits marked reachable"
msgstr "прекалено много подавания са отбелязани като достижими"
+msgid "could not determine MIDX preferred pack"
+msgstr ""
+"предпочитаният пакет за файла с индекса за множество пакети не може да се "
+"определи"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [ОПЦИЯ…]"
@@ -23444,6 +23613,9 @@ msgstr "„.git“ е повреден"
msgid ".git file incorrect"
msgstr "„.git“ е неправилен"
+msgid ".git file absolute/relative path mismatch"
+msgstr "несъвпадение на абсолютния/относителния път на „.git“"
+
msgid "not a valid path"
msgstr "неправилен път"
@@ -23459,6 +23631,9 @@ msgstr "не може да се открие хранилище: „.git“ е �
msgid "gitdir unreadable"
msgstr "директорията „gitdir“ не може да се прочете"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "„gitdir“ указва несъвпадение на абсолютния/относителния път"
+
msgid "gitdir incorrect"
msgstr "неправилна директория „gitdir“"
@@ -23495,6 +23670,14 @@ msgstr "„%s“ не може да се изчисти в „%s“"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "неуспешно задаване на настройката „extensions.worktreeConfig“"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"форматът на хранилището не може да се обнови за поддръжката на относителни "
+"работни дървета"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "неуспешно задаване на настройката „extensions.relativeWorktrees“"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "променливата на средата „%s“ не може да се зададе чрез „setenv“"
diff --git a/po/de.po b/po/de.po
index 06055e7611..addd5919bd 100644
--- 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: 2024-10-05 16:17+0200\n"
-"PO-Revision-Date: 2024-10-05 16:18+0200\n"
+"POT-Creation-Date: 2024-12-20 17:44+0100\n"
+"PO-Revision-Date: 2024-12-27 16:43+0100\n"
"Last-Translator: Ralf Thielow <ralf.thielow@gmail.com>\n"
"Language-Team: German\n"
"Language: de\n"
@@ -366,11 +366,11 @@ msgstr ""
#, c-format
msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Modusänderung vom Index und Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
+"Modusänderung im Index und Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
#, c-format
msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
-msgstr "Löschung vom Index und Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
+msgstr "Löschung im Index und Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
#, c-format
msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
@@ -379,7 +379,7 @@ msgstr "Ergänzung im Index und Arbeitsverzeichnis verwerfen [y,n,q,a,d%s,?]? "
#, c-format
msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Diesen Patch-Block vom Index und Arbeitsverzeichnis verwerfen [y,n,q,a,"
+"Diesen Patch-Block im Index und Arbeitsverzeichnis verwerfen [y,n,q,a,"
"d%s,?]? "
msgid ""
@@ -650,10 +650,10 @@ msgstr "Nur Binärdateien geändert."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Deaktivieren Sie diese Nachricht mit \"git config advice.%s false\""
+"Deaktivieren Sie diese Meldung mit \"git config set advice.%s false\""
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -3962,10 +3962,9 @@ msgstr "neuer ungeborener Branch"
msgid "update ignored files (default)"
msgstr "ignorierte Dateien aktualisieren (Standard)"
-msgid "do not check if another worktree is holding the given ref"
+msgid "do not check if another worktree is using this branch"
msgstr ""
-"Prüfung, ob die Referenz bereits in einem anderen Arbeitsverzeichnis "
-"ausgecheckt wurde, deaktivieren"
+"nicht prüfen, ob ein anderes Arbeitsverzeichnis diesen Branch verwendet"
msgid "checkout our version for unmerged files"
msgstr "unsere Variante für nicht zusammengeführte Dateien auschecken"
@@ -4272,13 +4271,11 @@ msgstr ""
"Zeit\n"
"erstellen"
-msgid "revision"
-msgstr "Commit"
+msgid "ref"
+msgstr "Referenz"
-msgid "deepen history of shallow clone, excluding rev"
-msgstr ""
-"die Historie eines Klons mit unvollständiger Historie (shallow) mittels\n"
-"Ausschluss eines Commits vertiefen"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "Historie eines flachen Klons vertiefen, Referenz exkludiert"
msgid "clone only one branch, HEAD or --branch"
msgstr "nur einen Branch klonen, HEAD oder --branch"
@@ -5232,8 +5229,7 @@ msgid ""
"regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>"
msgstr ""
"git config get [<Datei-Option>] [<Anzeige-Option>] [--includes] [--all] [--"
-"regexp] [--value=<Wert>] [--fixed-value] [--default=<Standardwert>] "
-"<Name>"
+"regexp] [--value=<Wert>] [--fixed-value] [--default=<Standardwert>] <Name>"
msgid ""
"git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--"
@@ -5244,10 +5240,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
"git config unset [<Datei-Option>] [--all] [--value=<Wert>] [--fixed-value] "
-"<Name> <Wert>"
+"<Name>"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr "git config rename-section [<Datei-Option>] <alter-Name> <neuer-Name>"
@@ -5695,12 +5691,8 @@ msgid "traversed %lu commits\n"
msgstr "%lu Commits durchlaufen\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"mehr als %i Tags gefunden; führe die ersten %i auf\n"
-"Suche bei %s aufgegeben\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "%i Tags gefunden; Suche bei %s aufgegeben\n"
#, c-format
msgid "describe %s\n"
@@ -6142,6 +6134,20 @@ msgstr "%s ist kein gültiges Objekt"
msgid "the object %s does not exist"
msgstr "das Objekt %s ist nicht vorhanden"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Führen Sie 'git remote set-head %s %s' aus, um der Änderung zu folgen,\n"
+"oder setzen Sie die Konfiguration 'remote.%s.followRemoteHEAD' auf einen\n"
+"anderen Wert, wenn Sie diese Meldung nicht sehen wollen. Konkret wird diese\n"
+"Warnung mit 'git config set remote.%s.followRemoteHEAD %s' deaktiviert\n"
+"bis die Gegenstelle HEAD in etwas anderes ändert."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "mehrere Branches erkannt, inkompatibel mit --set-upstream"
@@ -6287,6 +6293,9 @@ msgstr "Refmap"
msgid "specify fetch refmap"
msgstr "Refmap für 'fetch' angeben"
+msgid "revision"
+msgstr "Commit"
+
msgid "report that we have only objects reachable from this object"
msgstr ""
"ausgeben, dass wir nur Objekte haben, die von diesem Objekt aus erreichbar "
@@ -7030,8 +7039,26 @@ msgstr "weder Timer von systemd, noch crontab ist verfügbar"
msgid "%s scheduler is not available"
msgstr "%s Scheduler ist nicht verfügbar"
-msgid "another process is scheduling background maintenance"
-msgstr "ein anderer Prozess plant die Hintergrundwartung"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"Konnte '%s.lock' nicht erstellen: %s.\n"
+"\n"
+"Ein weiterer geplanter git-maintenance(1)-Prozess scheint in diesem\n"
+"Repository zu laufen. Bitte stellen Sie sicher, dass keine anderen\n"
+"Wartungsprozesse laufen und versuchen Sie es dann erneut. Wenn es\n"
+"immer noch fehlschlägt, ist möglicherweise ein git-maintenance(1)-Prozess\n"
+"in diesem Repository abgestürzt: Entfernen Sie die Datei manuell, um\n"
+"fortzufahren."
+
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "kann keine Sperre für die geplante Hintergrundwartung erhalten"
msgid "git maintenance start [--scheduler=<scheduler>]"
msgstr "git maintenance start [--scheduler=<Scheduler>]"
@@ -7612,6 +7639,22 @@ msgid_plural "chain length = %d: %lu objects"
msgstr[0] "Länge der Objekt-Liste = %d: %lu Objekt"
msgstr[1] "Länge der Objekt-Liste = %d: %lu Objekte"
+msgid "could not start pack-objects to repack local links"
+msgstr ""
+"konnte pack-objects nicht starten, um lokale Verknüpfungen neu zu packen"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "lokales Objekt konnte nicht an pack-objects übergeben werden"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: Erwarte vollständige Hex-Objekt-ID-Zeilen nur von pack-objects."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr ""
+"konnte pack-objects nicht vollständig ausführen, um lokale Verknüpfungen neu "
+"zu packen"
+
msgid "Cannot come back to cwd"
msgstr "Kann nicht zurück zum Arbeitsverzeichnis wechseln"
@@ -7623,6 +7666,9 @@ msgstr "%s ist ungültig"
msgid "unknown hash algorithm '%s'"
msgstr "unbekannter Hash-Algorithmus '%s'"
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor kann nicht mit einem Paketnamen verwendet werden"
+
msgid "--stdin requires a git repository"
msgstr "--stdin erfordert ein Git-Repository"
@@ -9003,11 +9049,11 @@ msgstr "git notes [--ref <Notiz-Referenz>] [list [<Objekt>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <Notiz-Referenz>] add [-f] [--allow-empty] [--"
"[no-]separator|--separator=<Absatz-Unterbrechung>] [--[no-]stripspace] [-m "
-"<Nachricht> | -F <Datei> | (-c | -C) <Objekt>] [<Objekt>]"
+"<Nachricht> | -F <Datei> | (-c | -C) <Objekt>] [<Objekt>] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
@@ -9016,11 +9062,11 @@ msgstr ""
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <Notiz-Referenz>] append [--allow-empty] [--"
"[no-]separator|--separator=<Absatz-Unterbrechnung>] [--[no-]stripspace] [-m "
-"<Nachricht> | -F <Datei> | (-c | -C) <Objekt>] [<Object>]"
+"<Nachricht> | -F <Datei> | (-c | -C) <Objekt>] [<Objekt>] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <Notiz-Referenz>] edit [--allow-empty] [<Objekt>]"
@@ -9142,6 +9188,9 @@ msgstr "Notizinhalte in einer Datei"
msgid "reuse and edit specified note object"
msgstr "Wiederverwendung und Bearbeitung des angegebenen Notiz-Objektes"
+msgid "edit note message in editor"
+msgstr "Notizmeldung im Editor bearbeiten"
+
msgid "reuse specified note object"
msgstr "Wiederverwendung des angegebenen Notiz-Objektes"
@@ -9655,6 +9704,9 @@ msgstr ""
"keine Objekte aus Packdateien von partiell geklonten Remote-Repositories "
"packen"
+msgid "implies --missing=allow-any"
+msgstr "impliziert --missing=allow-any"
+
msgid "respect islands during delta compression"
msgstr "Delta-Islands bei Delta-Kompression beachten"
@@ -11317,6 +11369,30 @@ msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " Lokale Referenz konfiguriert für 'git push'%s:"
msgstr[1] " Lokale Referenzen konfiguriert für 'git push'%s:"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "'%s/HEAD' ist unverändert und zeigt auf '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' hat sich von '%s' geändert und zeigt jetzt auf '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "'%s/HEAD' ist nun erstellt und zeigt auf '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' war losgelöst bei '%s' und zeigt nun auf '%s'\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"'%s/HEAD' zeigte vorher auf '%s' (was kein Remote-Branch ist), zeigt jetzt "
+"aber auf '%s'\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "setzt refs/remotes/<Name>/HEAD gemäß dem Remote-Repository"
@@ -11340,7 +11416,7 @@ msgid "Not a valid ref: %s"
msgstr "keine gültige Referenz: %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "Konnte %s nicht einrichten"
#, c-format
@@ -14142,6 +14218,9 @@ msgstr ""
"versuchen, eine Übereinstimmung des Branchnamens mit einem\n"
"Remote-Tracking-Branch herzustellen"
+msgid "use relative paths for worktrees"
+msgstr "relative Pfade für Arbeitsverzeichnisse verwenden"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr ""
@@ -14426,6 +14505,28 @@ msgstr "kann '%s' nicht erstellen"
msgid "index-pack died"
msgstr "Erstellung der Paketindexdatei abgebrochen"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "Verzeichnis '%s' ist im Index vorhanden, aber nicht partiell"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr ""
+"das beschädigte Cache-Verzeichnis enthält Einträge, die nicht im Index "
+"enthalten sind"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s mit Flags 0x%x sollte nicht im Cache-Verzeichnis sein"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "ungültiges Unterverzeichnis '%.*s'"
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr ""
+"Cache-Verzeichnis für Pfad %.*s stimmt nicht überein. Erwartete %s bekam %s"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "abschließende Chunk-ID erscheint eher als erwartet"
@@ -15322,17 +15423,18 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Die Unterstützung für <GIT_DIR>/info/grafts ist veraltet\n"
-"und wird in zukünftigen Git Versionen entfernt.\n"
+"und wird in einer zukünftigen Git-Version entfernt.\n"
"\n"
-"Bitte benutzen Sie \"git replace --convert-graft-file\"\n"
-"zum Konvertieren der künstlichen Vorgänger (\"grafts\")\n"
-"in ersetzende Referenzen.<\n"
+"Bitte verwenden Sie \"git replace --convert-graft-file\"\n"
+"um die künstlichen Vorgänger (\"graft\") in ersetzende Referenzen\n"
+"zu konvertieren.\n"
"\n"
-"Sie können diese Meldung unterdrücken, indem Sie\n"
-"\"git config advice.graftFileDeprecated false\" ausführen."
+"Deaktivieren Sie diese Meldung, indem Sie\n"
+"\"git config set advice.graftFileDeprecated false\"\n"
+"ausführen."
#, c-format
msgid "commit %s exists in commit-graph but not in the object database"
@@ -16166,6 +16268,18 @@ msgstr "URL hat kein Schema: %s"
msgid "credential url cannot be parsed: %s"
msgstr "URL mit Zugangsdaten konnte nicht geparst werden: %s"
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "ungültiger timeout '%s', nicht-negative ganze Zahl erwartet"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr "ungültiger init-timeout '%s', nicht-negative ganze Zahl erwartet"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "ungültiges max-connections '%s', ganze Zahl erwartet"
+
msgid "in the future"
msgstr "in der Zukunft"
@@ -16896,6 +17010,22 @@ msgstr "ungültiger Git-Namespace-Pfad \"%s\""
msgid "too many args to run %s"
msgstr "zu viele Argumente angegeben, um %s auszuführen"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Sie versuchen %s zu holen, welches sich in der Commit-Graph-Datei, aber "
+"nicht in der Objektdatenbank befindet.\n"
+"Dies ist wahrscheinlich auf eine Beschädigung des Repositories "
+"zurückzuführen.\n"
+"Wenn Sie versuchen, die Beschädigung des Repositories zu beheben, indem Sie "
+"das fehlende Objekt erneut holen,\n"
+"verwenden Sie 'git fetch --refetch' mit dem fehlenden Objekt."
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: erwartete shallow-Liste"
@@ -17329,8 +17459,8 @@ msgid ""
"given pattern contains NULL byte (via -f <file>). This is only supported "
"with -P under PCRE v2"
msgstr ""
-"Angegebenes Muster enthält NULL Byte (über -f <Datei>). Das wird nur mit -"
-"Punter PCRE v2 unterstützt."
+"Angegebenes Muster enthält NULL Byte (über -f <Datei>). Das wird nur mit -P "
+"unter PCRE v2 unterstützt."
#, c-format
msgid "'%s': unable to read %s"
@@ -17483,10 +17613,11 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
-"Der '%s' Hook wurde ignoriert, weil er nicht als ausführbar markiert ist.\n"
-"Sie können diese Warnung mit `git config advice.ignoredHook false` "
+"Der '%s'-Hook wurde ignoriert, weil er nicht als ausführbar eingestellt "
+"ist.\n"
+"Sie können diese Warnung mit `git config set advice.ignoredHook false` "
"deaktivieren."
msgid "not a git repository"
@@ -17503,17 +17634,9 @@ msgstr "negativer Wert für http.postBuffer; benutze Standardwert %d"
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Kontrolle über Delegation wird mit cURL < 7.22.0 nicht unterstützt"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr ""
-"Das Anheften des öffentlichen Schlüssels wird mit cURL < 7.39.0 nicht "
-"unterstützt"
-
msgid "Unknown value for http.proactiveauth"
msgstr "Unbekannter Wert für http.proactiveauth"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE wird mit cURL < 7.44.0 nicht unterstützt."
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "Nicht unterstütztes SSL-Backend '%s'. Unterstützte SSL-Backends:"
@@ -17701,6 +17824,10 @@ msgid "unable to format message: %s"
msgstr "Meldung kann nicht formatiert werden: %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "ungültige marker-size '%s', ganze Zahl erwartet"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Fehler beim Merge von Submodul %s (nicht ausgecheckt)."
@@ -18837,19 +18964,18 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
-"Git erzeugt normalerweise keine Referenzen die mit\n"
-"40 Hex-Zeichen enden, da diese ignoriert werden wenn\n"
-"Sie diese angeben. Diese Referenzen könnten aus Versehen\n"
-"erzeugt worden sein. Zum Beispiel,\n"
+"Git erstellt normalerweise nie eine Referenz, die mit 40-Hex-Zeichen endet,\n"
+"weil sie ignoriert wird, wenn Sie nur 40-Hex-Zeichen angeben. Diese\n"
+"Referenzen können aus Versehen erstellt werden. Zum Beispiel,\n"
"\n"
" git switch -c $br $(git rev-parse ...)\n"
"\n"
-"wobei \"$br\" leer ist und eine 40-Hex-Referenz erzeugt\n"
-"wurde. Bitte prüfen Sie diese Referenzen und löschen\n"
-"Sie sie gegebenenfalls. Unterdrücken Sie diese Meldung\n"
-"indem Sie \"git config advice.objectNameWarning false\"\n"
+"wobei \"$br\" irgendwie leer ist und eine 40-Hex-Referenz erstellt wird.\n"
+"Bitte überprüfen Sie die Referenzen und löschen Sie diese gegebenenfalls.\n"
+"Schalten Sie diese Meldung aus, indem Sie\n"
+"\"git config set advice.objectNameWarning false\"\n"
"ausführen."
#, c-format
@@ -19010,13 +19136,6 @@ msgstr "Multi-Pack-Bitmap fehlt erforderlicher Reverse-Index"
msgid "could not open pack %s"
msgstr "konnte Paket '%s' nicht öffnen"
-msgid "could not determine MIDX preferred pack"
-msgstr "konnte das von MIDX bevorzugte Paket nicht ermitteln"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "bevorzugtes Paket (%s) ist ungültig"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "Bitmap-Lookup-Tabelle beschädigt: Triplet-Position außerhalb des Index"
@@ -20151,18 +20270,26 @@ msgstr "Log für Referenz %s unerwartet bei %s beendet."
msgid "log for %s is empty"
msgstr "Log für %s ist leer."
-msgid "refusing to force and skip creation of reflog"
-msgstr "Erzwingen der Aktion verweigert; überspringe Erstellung des Reflogs"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "verweigere Aktualisierung einer Referenz mit fehlerhaftem Namen '%s'"
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "Aktualisierung des Reflogs für Pseudoreferenz '%s' verweigert"
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "Aktualisierung von Pseudoreferenz '%s' verweigert"
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "Aktualisierung des Reflogs mit fehlerhaftem Namen '%s' verweigert"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "verweigere Aktualisierung einer Referenz mit fehlerhaftem Namen '%s'"
+
+msgid "refusing to force and skip creation of reflog"
+msgstr "Erzwingen der Aktion verweigert; überspringe Erstellung des Reflogs"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "update_ref für Referenz '%s' fehlgeschlagen: %s"
@@ -20216,6 +20343,10 @@ msgstr ""
"'%s': ist aber eine reguläre Referenz"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "kann Ref-Datei '%s' nicht lesen"
+
+#, c-format
msgid "cannot open directory %s"
msgstr "Verzeichnis %s kann nicht geöffnet werden"
@@ -20431,6 +20562,10 @@ msgid "more than one uploadpack given, using the first"
msgstr "Mehr als ein uploadpack-Befehl angegeben, benutze den ersten."
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "nicht erkannter followRemoteHEAD-Wert '%s' ignoriert"
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "unbekannter Wert transfer.credentialsInUrl: '%s'"
@@ -22391,6 +22526,9 @@ msgstr "Commit %s ist nicht als erreichbar gekennzeichnet."
msgid "too many commits marked reachable"
msgstr "Zu viele Commits als erreichbar gekennzeichnet."
+msgid "could not determine MIDX preferred pack"
+msgstr "konnte das von MIDX bevorzugte Paket nicht ermitteln"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<Optionen>]"
@@ -23061,6 +23199,9 @@ msgstr ".git-Datei kaputt"
msgid ".git file incorrect"
msgstr ".git-Datei fehlerhaft"
+msgid ".git file absolute/relative path mismatch"
+msgstr "absoluter/relativer Pfad der .git-Datei stimmt nicht überein"
+
msgid "not a valid path"
msgstr "kein gültiger Pfad"
@@ -23077,6 +23218,9 @@ msgstr "Konnte Repository nicht finden; .git-Datei ist kaputt"
msgid "gitdir unreadable"
msgstr "gitdir nicht lesbar"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "absolute/relative Pfadabweichung in gitdir"
+
msgid "gitdir incorrect"
msgstr "gitdir fehlerhaft"
@@ -23111,6 +23255,14 @@ msgstr "konnte %s nicht in '%s' aufheben"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "Einstellung für extensions.worktreeConfig konnte nicht gesetzt werden"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"Repository-Format konnte nicht aktualisiert werden, um relative "
+"Arbeitsverzeichnisse zu unterstützen"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "Einstellung extensions.relativeWorktrees kann nicht gesetzt werden"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "konnte '%s' nicht setzen"
@@ -24038,3 +24190,7 @@ 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]: "
+
+#, c-format
+#~ msgid "preferred pack (%s) is invalid"
+#~ msgstr "bevorzugtes Paket (%s) ist ungültig"
diff --git a/po/fr.po b/po/fr.po
index 481e1bdc1d..64a75aecf5 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -29,6 +29,7 @@
# to debug | déboguer
# debugging | débogage
# to deflate | compresser
+# directory | répertoire
# email | courriel
# enlistment | enrôlement
# entry | élément
@@ -45,18 +46,23 @@
# hunk | section
# to inflate | décompresser
# to list | afficher
+# loose object | objet esseulé
# mapping | mise en correspondance
# merge | fusion
# pack | paquet
-# patches | patchs
+# patch (v) | appliquer une/des rustine(s)
+# patches | rustines
# pattern | motif
# to prune | élaguer
# to push | pousser
# to rebase | rebaser
# scheduler | planificateur
# trailers | lignes terminales
-# repository | dépôt
+# regex | regex
+# regular |
+# expression | expression régulière
# remote | distante (ou serveur distant)
+# repository | dépôt
# revision | révision
# shallow | superficiel
# shell | interpréteur de commandes
@@ -64,6 +70,7 @@
# split (index) | index scindé
# stash | remisage
# to stash | remiser
+# superproject | super-projet
# tag | étiquette
# template | modèle
# thread | fil
@@ -80,8 +87,8 @@ msgid ""
msgstr ""
"Project-Id-Version: git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2024-10-02 16:57+0000\n"
-"PO-Revision-Date: 2024-10-04 23:03+0200\n"
+"POT-Creation-Date: 2024-12-23 18:57+0000\n"
+"PO-Revision-Date: 2024-12-29 18:26+0100\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"
@@ -169,7 +176,7 @@ msgid "No changes.\n"
msgstr "Aucune modification.\n"
msgid "Patch update"
-msgstr "Mise à jour par patch"
+msgstr "Mise à jour par rustine"
msgid "Review diff"
msgstr "Réviser la différence"
@@ -267,7 +274,7 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"staging."
msgstr ""
-"Si le patch s'applique proprement, la section éditée sera immédiatement "
+"Si la rustine s'applique proprement, la section éditée sera immédiatement "
"marquée comme indexée."
msgid ""
@@ -303,7 +310,7 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"stashing."
msgstr ""
-"Si le patch s'applique proprement, la section éditée sera immédiatement "
+"Si la rustine s'applique proprement, la section éditée sera immédiatement "
"marquée comme remisée."
msgid ""
@@ -339,7 +346,7 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"unstaging."
msgstr ""
-"Si le patch s'applique proprement, la section éditée sera immédiatement "
+"Si la rustine s'applique proprement, la section éditée sera immédiatement "
"marquée comme desindexée."
msgid ""
@@ -375,7 +382,7 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"applying."
msgstr ""
-"Si le patch s'applique proprement, la section éditée sera immédiatement "
+"Si la rustine s'applique proprement, la section éditée sera immédiatement "
"marquée comme appliquée."
msgid ""
@@ -411,7 +418,7 @@ msgid ""
"If the patch applies cleanly, the edited hunk will immediately be marked for "
"discarding."
msgstr ""
-"Si le patch s'applique proprement, la section éditée sera immédiatement "
+"Si la rustine s'applique proprement, la section éditée sera immédiatement "
"marquée comme éliminée."
msgid ""
@@ -461,14 +468,14 @@ msgstr ""
#, c-format
msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Appliquer le changement de mode dans l'index et l'arbre de travail [y,n,q,a,"
-"d%s,?] ? "
+"Appliquer le changement de mode dans l'index et l'arbre de travail "
+"[y,n,q,a,d%s,?] ? "
#, c-format
msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
msgstr ""
-"Appliquer la suppression dans l'index et l'arbre de travail [y,n,q,a,"
-"d%s,?] ? "
+"Appliquer la suppression dans l'index et l'arbre de travail "
+"[y,n,q,a,d%s,?] ? "
#, c-format
msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
@@ -710,10 +717,10 @@ msgstr "Seuls des fichiers binaires ont changé."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Désactivez ce message avec \"git config advice.%s false\""
+"Désactivez ce message avec \"git config set advice.%s false\""
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -837,8 +844,8 @@ msgstr ""
"\n"
" git switch -\n"
"\n"
-"Désactivez ce conseil en renseignant la variable de configuration advice."
-"detachedHead à false\n"
+"Désactivez ce conseil en renseignant la variable de configuration "
+"advice.detachedHead à false\n"
"\n"
#, c-format
@@ -893,7 +900,7 @@ msgstr "la rustine est trop grosse"
#, c-format
msgid "Cannot prepare timestamp regexp %s"
-msgstr "Impossible de préparer la regexp d'horodatage %s"
+msgstr "Impossible de préparer la regex d'horodatage %s"
#, c-format
msgid "regexec returned %d for input: %s"
@@ -901,7 +908,7 @@ msgstr "regexec a retourné %d pour l'entrée : %s"
#, c-format
msgid "unable to find filename in patch at line %d"
-msgstr "nom de fichier du patch introuvable à la ligne %d"
+msgstr "nom de fichier de la rustine introuvable à la ligne %d"
#, c-format
msgid "git apply: bad git-diff - expected /dev/null, got %s on line %d"
@@ -912,14 +919,14 @@ msgstr ""
#, c-format
msgid "git apply: bad git-diff - inconsistent new filename on line %d"
msgstr ""
-"git apply : mauvais format de git-diff - nouveau nom de fichier inconsistant "
-"à la ligne %d"
+"git apply : mauvais format de git-diff - nouveau nom de fichier incohérent à "
+"la ligne %d"
#, c-format
msgid "git apply: bad git-diff - inconsistent old filename on line %d"
msgstr ""
-"git apply : mauvais format de git-diff - ancien nom de fichier inconsistant "
-"à la ligne %d"
+"git apply : mauvais format de git-diff - ancien nom de fichier incohérent à "
+"la ligne %d"
#, c-format
msgid "git apply: bad git-diff - expected /dev/null on line %d"
@@ -959,7 +966,7 @@ msgstr "recomptage : ligne inattendue : %.*s"
#, c-format
msgid "patch fragment without header at line %d: %.*s"
-msgstr "fragment de patch sans en-tête à la ligne %d : %.*s"
+msgstr "fragment de rustine sans en-tête à la ligne %d : %.*s"
msgid "new file depends on old contents"
msgstr "le nouveau fichier dépend de contenus anciens"
@@ -969,7 +976,7 @@ msgstr "le fichier supprimé a encore du contenu"
#, c-format
msgid "corrupt patch at line %d"
-msgstr "patch corrompu à la ligne %d"
+msgstr "rustine corrompue à la ligne %d"
#, c-format
msgid "new file %s depends on old contents"
@@ -985,15 +992,15 @@ msgstr "** attention : le fichier %s devient vide mais n'est pas supprimé"
#, c-format
msgid "corrupt binary patch at line %d: %.*s"
-msgstr "patch binaire corrompu à la ligne %d : %.*s"
+msgstr "rustine binaire corrompue à la ligne %d : %.*s"
#, c-format
msgid "unrecognized binary patch at line %d"
-msgstr "patch binaire non reconnu à la ligne %d"
+msgstr "rustine binaire non reconnue à la ligne %d"
#, c-format
msgid "patch with only garbage at line %d"
-msgstr "patch totalement incompréhensible à la ligne %d"
+msgstr "rustine totalement incompréhensible à la ligne %d"
#, c-format
msgid "unable to read symlink %s"
@@ -1027,28 +1034,30 @@ msgstr ""
#, c-format
msgid "missing binary patch data for '%s'"
-msgstr "données de patch binaire manquantes pour '%s'"
+msgstr "données de rustine binaire manquantes pour '%s'"
#, c-format
msgid "cannot reverse-apply a binary patch without the reverse hunk to '%s'"
msgstr ""
-"impossible d'appliquer l'inverse d'un patch binaire à '%s' sans la section "
-"inverse"
+"impossible d'appliquer l'inverse d'une rustine binaire à '%s' sans la "
+"section inverse"
#, c-format
msgid "cannot apply binary patch to '%s' without full index line"
msgstr ""
-"impossible d'appliquer un patch binaire à '%s' sans la ligne complète d'index"
+"impossible d'appliquer une rustine binaire à '%s' sans la ligne complète "
+"d'index"
#, c-format
msgid ""
"the patch applies to '%s' (%s), which does not match the current contents."
msgstr ""
-"le patch s'applique à '%s' (%s), ce qui ne correspond pas au contenu actuel."
+"la rustine s'applique à '%s' (%s), ce qui ne correspond pas au contenu "
+"actuel."
#, c-format
msgid "the patch applies to an empty '%s' but it is not empty"
-msgstr "le patch s'applique à un '%s' vide mais ce n'est pas vide"
+msgstr "la rustine s'applique à un '%s' vide mais ce n'est pas vide"
#, c-format
msgid "the necessary postimage %s for '%s' cannot be read"
@@ -1056,17 +1065,17 @@ msgstr "l'image postérieure nécessaire %s pour '%s' ne peut pas être lue"
#, c-format
msgid "binary patch does not apply to '%s'"
-msgstr "le patch binaire ne s'applique par correctement à '%s'"
+msgstr "la rustine binaire ne s'applique par correctement à '%s'"
#, c-format
msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
msgstr ""
-"le patch binaire sur '%s' crée un résultat incorrect (%s attendu, mais %s "
+"la rustine binaire sur '%s' crée un résultat incorrect (%s attendu, mais %s "
"trouvé)"
#, c-format
msgid "patch failed: %s:%ld"
-msgstr "le patch a échoué : %s:%ld"
+msgstr "l'application de la rustine a échoué : %s:%ld"
#, c-format
msgid "cannot checkout %s"
@@ -1110,18 +1119,18 @@ msgstr "Échec de l'application de la fusion à 3 points…\n"
#, c-format
msgid "Applied patch to '%s' with conflicts.\n"
-msgstr "Patch %s appliqué avec des conflits.\n"
+msgstr "Rustine %s appliquée avec des conflits.\n"
#, c-format
msgid "Applied patch to '%s' cleanly.\n"
-msgstr "Patch %s appliqué proprement.\n"
+msgstr "Rustine %s appliquée proprement.\n"
#, c-format
msgid "Falling back to direct application...\n"
msgstr "Retour à une application directe…\n"
msgid "removal patch leaves file contents"
-msgstr "le patch de suppression laisse un contenu dans le fichier"
+msgstr "la rustine de suppression laisse un contenu dans le fichier"
#, c-format
msgid "%s: wrong type"
@@ -1158,11 +1167,11 @@ msgstr "le fichier affecté '%s' est au-delà d'un lien symbolique"
#, c-format
msgid "%s: patch does not apply"
-msgstr "%s : le patch ne s'applique pas"
+msgstr "%s : la rustine ne s'applique pas"
#, c-format
msgid "Checking patch %s..."
-msgstr "Vérification du patch %s..."
+msgstr "Vérification de la rustine %s..."
#, c-format
msgid "sha1 information is lacking or useless for submodule %s"
@@ -1191,7 +1200,7 @@ msgstr "suppression de %s dans l'index impossible"
#, c-format
msgid "corrupt patch for submodule %s"
-msgstr "patch corrompu pour le sous-module %s"
+msgstr "rustine corrompue pour le sous-module %s"
#, c-format
msgid "unable to stat newly created file '%s'"
@@ -1221,7 +1230,7 @@ msgstr "écriture du fichier '%s' mode %o impossible"
#, c-format
msgid "Applied patch %s cleanly."
-msgstr "Patch %s appliqué proprement."
+msgstr "Rustine %s appliquée proprement."
msgid "internal error"
msgstr "erreur interne"
@@ -1229,8 +1238,8 @@ msgstr "erreur interne"
#, c-format
msgid "Applying patch %%s with %d reject..."
msgid_plural "Applying patch %%s with %d rejects..."
-msgstr[0] "Application du patch %%s avec %d rejet..."
-msgstr[1] "Application du patch %%s avec %d rejets..."
+msgstr[0] "Application de la rustine %%s avec %d rejet..."
+msgstr[1] "Application de la rustine %%s avec %d rejets..."
#, c-format
msgid "cannot open %s"
@@ -1260,7 +1269,7 @@ msgstr "lecture du fichier d'index impossible"
#, c-format
msgid "can't open patch '%s': %s"
-msgstr "ouverture impossible du patch '%s' :%s"
+msgstr "ouverture impossible de la rustine '%s' :%s"
#, c-format
msgid "squelched %d whitespace error"
@@ -1296,35 +1305,35 @@ msgid "remove <num> leading slashes from traditional diff paths"
msgstr "supprimer <num> barres obliques des chemins traditionnels de diff"
msgid "ignore additions made by the patch"
-msgstr "ignorer les additions réalisées par le patch"
+msgstr "ignorer les additions réalisées par la rustine"
msgid "instead of applying the patch, output diffstat for the input"
-msgstr "au lieu d'appliquer le patch, afficher le diffstat de l'entrée"
+msgstr "au lieu d'appliquer la rustine, afficher le diffstat de l'entrée"
msgid "show number of added and deleted lines in decimal notation"
msgstr ""
"afficher le nombre de lignes ajoutées et supprimées en notation décimale"
msgid "instead of applying the patch, output a summary for the input"
-msgstr "au lieu d'appliquer le patch, afficher un résumé de l'entrée"
+msgstr "au lieu d'appliquer la rustine, afficher un résumé de l'entrée"
msgid "instead of applying the patch, see if the patch is applicable"
-msgstr "au lieu d'appliquer le patch, voir si le patch est applicable"
+msgstr "au lieu d'appliquer la rustine, voir si la rustine est applicable"
msgid "make sure the patch is applicable to the current index"
-msgstr "s'assurer que le patch est applicable sur l'index actuel"
+msgstr "s'assurer que la rustine est applicable sur l'index actuel"
msgid "mark new files with `git add --intent-to-add`"
msgstr "marquer les nouveaux fichiers `git add --intent-to-add`"
msgid "apply a patch without touching the working tree"
-msgstr "appliquer les patch sans toucher à la copie de travail"
+msgstr "appliquer les rustines sans toucher à la copie de travail"
msgid "accept a patch that touches outside the working area"
-msgstr "accepter un patch qui touche hors de la copie de travail"
+msgstr "accepter une rustine qui touche hors de la copie de travail"
msgid "also apply the patch (use with --stat/--summary/--check)"
-msgstr "appliquer aussi le patch (à utiliser avec --stat/--summary/--check)"
+msgstr "appliquer aussi la rustine (à utiliser avec --stat/--summary/--check)"
msgid "attempt three-way merge, fall back on normal patch if that fails"
msgstr ""
@@ -1361,7 +1370,7 @@ msgid "ignore changes in whitespace when finding context"
msgstr "ignorer des modifications d'espace lors de la recherche de contexte"
msgid "apply the patch in reverse"
-msgstr "appliquer le patch en sens inverse"
+msgstr "appliquer la rustine en sens inverse"
msgid "don't expect at least one line of context"
msgstr "ne pas s'attendre à au moins une ligne de contexte"
@@ -1465,8 +1474,9 @@ msgstr "nom d'objet invalide : %s"
msgid "not a tree object: %s"
msgstr "objet arbre invalide : %s"
-msgid "unable to checkout working tree"
-msgstr "impossible d'extraire la copie de travail"
+#, c-format
+msgid "failed to unpack tree object %s"
+msgstr "échec du dépaquetage de l'objet arbre %s"
#, c-format
msgid "File not found: %s"
@@ -1923,7 +1933,7 @@ msgid "could not read the index"
msgstr "impossible de lire l'index"
msgid "editing patch failed"
-msgstr "échec de l'édition du patch"
+msgstr "échec de l'édition de la rustine"
#, c-format
msgid "could not stat '%s'"
@@ -2031,7 +2041,7 @@ msgid "adding embedded git repository: %s"
msgstr "dépôt git embarqué ajouté : %s"
msgid "Use -f if you really want to add them."
-msgstr "Utilisez -f si vous voulez vraiment les ajouter<."
+msgstr "Utilisez -f si vous voulez vraiment les ajouter."
msgid "adding files failed"
msgstr "échec de l'ajout de fichiers"
@@ -2103,10 +2113,10 @@ msgstr "impossible d'ouvrir '%s' en écriture"
#, c-format
msgid "could not parse patch '%s'"
-msgstr "impossible d'analyser le patch '%s'"
+msgstr "impossible d'analyser la rustine '%s'"
msgid "Only one StGIT patch series can be applied at once"
-msgstr "Seulement une série de patchs StGIT peut être appliquée à la fois"
+msgstr "Seulement une série de rustines StGIT peut être appliquée à la fois"
msgid "invalid timestamp"
msgstr "horodatage invalide"
@@ -2118,14 +2128,14 @@ msgid "invalid timezone offset"
msgstr "décalage horaire invalide"
msgid "Patch format detection failed."
-msgstr "Échec de détection du format du patch."
+msgstr "Échec de détection du format de la rustine."
#, c-format
msgid "failed to create directory '%s'"
msgstr "échec de la création du répertoire '%s'"
msgid "Failed to split patches."
-msgstr "Échec de découpage des patchs."
+msgstr "Échec de découpage des rustines."
#, c-format
msgid "When you have resolved this problem, run \"%s --continue\".\n"
@@ -2145,8 +2155,8 @@ msgstr ""
#, c-format
msgid "To restore the original branch and stop patching, run \"%s --abort\"."
msgstr ""
-"Pour restaurer la branche originale et arrêter de patcher, lancez \"%s --"
-"abort\"."
+"Pour restaurer la branche originale et arrêter d'appliquer des rustines, "
+"lancez \"%s --abort\"."
msgid "Patch sent with format=flowed; space at the end of lines might be lost."
msgstr ""
@@ -2178,11 +2188,11 @@ msgid ""
"Did you hand edit your patch?\n"
"It does not apply to blobs recorded in its index."
msgstr ""
-"Avez-vous édité le patch à la main ?\n"
+"Avez-vous édité la rustine à la main ?\n"
"Il ne s'applique pas aux blobs enregistrés dans son index."
msgid "Falling back to patching base and 3-way merge..."
-msgstr "Retour à un patch de la base et fusion à 3 points..."
+msgstr "Retour à une rustine de la base et fusion à 3 points..."
msgid "Failed to merge in the changes."
msgstr "Échec d'intégration des modifications."
@@ -2216,7 +2226,7 @@ msgstr "impossible d'écrire le fichier d'index"
#, c-format
msgid "Dirty index: cannot apply patches (dirty: %s)"
-msgstr "Index sale : impossible d'appliquer des patchs (sales : %s)"
+msgstr "Index sale : impossible d'appliquer des rustines (sales : %s)"
#, c-format
msgid "Skipping: %.*s"
@@ -2227,7 +2237,7 @@ msgid "Creating an empty commit: %.*s"
msgstr "Création d'un commit vide : %.*s"
msgid "Patch is empty."
-msgstr "Le patch actuel est vide."
+msgstr "La rustine actuelle est vide."
#, c-format
msgid "Applying: %.*s"
@@ -2242,7 +2252,8 @@ msgstr "l'application de la rustine a échoué à %s %.*s"
msgid "Use 'git am --show-current-patch=diff' to see the failed patch"
msgstr ""
-"Utilisez 'git am --show-current-patch=diff' pour visualiser le patch en échec"
+"Utilisez 'git am --show-current-patch=diff' pour visualiser la rustine en "
+"échec"
msgid "No changes - recorded it as an empty commit."
msgstr "aucune modification - enregistré comme un commit vide."
@@ -2254,8 +2265,8 @@ msgid ""
msgstr ""
"Aucun changement - avez-vous oublié d'utiliser 'git add' ?\n"
"S'il n'y a plus rien à indexer, il se peut qu'autre chose ait déjà\n"
-"introduit les mêmes changements ; vous pourriez avoir envie de sauter ce "
-"patch."
+"introduit les mêmes changements ; vous pourriez avoir envie de sauter cette "
+"rustine."
msgid ""
"You still have unmerged paths in your index.\n"
@@ -2342,28 +2353,30 @@ msgid "format"
msgstr "format"
msgid "format the patch(es) are in"
-msgstr "format de présentation des patchs"
+msgstr "format de présentation des rustines"
msgid "override error message when patch failure occurs"
-msgstr "surcharger le message d'erreur lors d'un échec d'application de patch"
+msgstr ""
+"surcharger le message d'erreur lors d'un échec d'application d'une rustine"
msgid "continue applying patches after resolving a conflict"
-msgstr "continuer à appliquer les patchs après résolution d'un conflit"
+msgstr "continuer à appliquer les rustines après résolution d'un conflit"
msgid "synonyms for --continue"
msgstr "synonymes de --continue"
msgid "skip the current patch"
-msgstr "sauter le patch courant"
+msgstr "sauter la rustine courante"
msgid "restore the original branch and abort the patching operation"
-msgstr "restaurer la branche originale et abandonner les applications de patch"
+msgstr ""
+"restaurer la branche originale et abandonner les applications de rustines"
msgid "abort the patching operation but keep HEAD where it is"
-msgstr "abandonne l'opération de patch mais garde HEAD où il est"
+msgstr "abandonne l'opération de rustine mais garde HEAD où il est"
msgid "show the patch being applied"
-msgstr "afficher le patch en cours d'application"
+msgstr "afficher la rustine en cours d'application"
msgid "try to apply current patch again"
msgstr "essayer d'appliquer de nouveau la rustine"
@@ -3126,11 +3139,11 @@ msgid "HEAD not found below refs/heads!"
msgstr "HEAD non trouvée sous refs/heads !"
msgid ""
-"branch with --recurse-submodules can only be used if submodule."
-"propagateBranches is enabled"
+"branch with --recurse-submodules can only be used if "
+"submodule.propagateBranches is enabled"
msgstr ""
-"brancher avec --recurse-submodules ne peut être utilisé que si submodule."
-"propagateBranches est activé"
+"brancher avec --recurse-submodules ne peut être utilisé que si "
+"submodule.propagateBranches est activé"
msgid "--recurse-submodules can only be used to create branches"
msgstr "--recurse-submodules ne peut être utilisé que pour créer des branches"
@@ -3992,9 +4005,8 @@ msgstr "nouvelle branche non née"
msgid "update ignored files (default)"
msgstr "mettre à jour les fichiers ignorés (par défaut)"
-msgid "do not check if another worktree is holding the given ref"
-msgstr ""
-"ne pas vérifier si une autre copie de travail contient le référence fournie"
+msgid "do not check if another worktree is using this branch"
+msgstr "ne pas vérifier si une autre copie-de-travail utilise cette branche"
msgid "checkout our version for unmerged files"
msgstr "extraire notre version pour les fichiers non fusionnés"
@@ -4297,12 +4309,11 @@ msgstr "créer un clone superficiel de cette profondeur"
msgid "create a shallow clone since a specific time"
msgstr "créer un clone superficiel depuis une date spécifique"
-msgid "revision"
-msgstr "révision"
+msgid "ref"
+msgstr "ref"
-msgid "deepen history of shallow clone, excluding rev"
-msgstr ""
-"approfondir l'historique d'un clone superficiel en excluant une révision"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "approfondit l'historique d'un clone superficiel en excluant une ref"
msgid "clone only one branch, HEAD or --branch"
msgstr "cloner seulement une branche, HEAD ou --branch"
@@ -4386,7 +4397,7 @@ msgstr "échec pour délier '%s'"
#, c-format
msgid "hardlink cannot be checked at '%s'"
-msgstr "le lien dur ne peut pas être vérifier à '%s'"
+msgstr "le lien dur ne peut pas être vérifié à '%s'"
#, c-format
msgid "hardlink different from source at '%s'"
@@ -4436,6 +4447,9 @@ msgstr ""
"la HEAD distante réfère à une référence non existante, impossible de "
"l'extraire"
+msgid "unable to checkout working tree"
+msgstr "impossible d'extraire la copie de travail"
+
msgid "unable to write parameters to config file"
msgstr "impossible d'écrire les paramètres dans le fichier de configuration"
@@ -5255,10 +5269,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
"git config unset [<option-de-fichier>] [--all] [--value=<valeur>] [--fixed-"
-"value] <nom> <valeur>"
+"value] <nom>"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr ""
@@ -5486,7 +5500,7 @@ msgid "value"
msgstr "valeur"
msgid "use default value when missing entry"
-msgstr "utiliser le valeur par défaut quand l'entrée n'existe pas"
+msgstr "utiliser la valeur par défaut quand l'entrée n'existe pas"
msgid "--fixed-value only applies with 'value-pattern'"
msgstr "--fixed-value ne s'applique qu'à 'motif-de-valeur'"
@@ -5523,7 +5537,7 @@ msgid ""
" Use a regexp, --add or --replace-all to change %s."
msgstr ""
"impossible de surcharger des valeurs multiples avec une seule valeur\n"
-" Utilisez une regexp, --add ou --replace-all pour modifier %s."
+" Utilisez une regex, --add ou --replace-all pour modifier %s."
#, c-format
msgid "no such section: %s"
@@ -5549,7 +5563,7 @@ msgid "get all values: key [<value-pattern>]"
msgstr "obtenir toutes les valeurs : clé [<motif-de-valeur>]"
msgid "get values for regexp: name-regex [<value-pattern>]"
-msgstr "obtenir les valeur pour la regexp : name-regex [<motif-de-valeur>]"
+msgstr "obtenir les valeurs pour la regex : name-regex [<motif-de-valeur>]"
msgid "get value specific for the URL: section[.var] URL"
msgstr "obtenir la valeur spécifique pour l'URL : section[.var] URL"
@@ -5586,7 +5600,7 @@ msgid "find the color setting: slot [<stdout-is-tty>]"
msgstr "trouver le réglage de la couleur : slot [<stdout-est-tty>]"
msgid "with --get, use default value when missing entry"
-msgstr "avec --get, utiliser le valeur par défaut quand l'entrée n'existe pas"
+msgstr "avec --get, utiliser la valeur par défaut quand l'entrée n'existe pas"
msgid "--get-color and variable type are incoherent"
msgstr "--get-color et le type de la variable sont incohérents"
@@ -5623,7 +5637,7 @@ msgstr ""
"Les permissions de votre répertoire de socket sont trop permissives ;\n"
"les autres utilisateurs pourraient lire vos identifiants secrets. Lancez :\n"
"\n"
-" chmod 0700 %s"
+"\tchmod 0700 %s"
msgid "print debugging messages to stderr"
msgstr "afficher les messages de debug sur stderr"
@@ -5704,13 +5718,8 @@ msgid "traversed %lu commits\n"
msgstr "%lu commits parcourus\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"plus de %i étiquettes ont été trouvées; seules les %i plus récentes sont "
-"affichées\n"
-"abandon de la recherche à %s\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "%i étiquettes trouvées ; recherche abandonnée à %s\n"
#, c-format
msgid "describe %s\n"
@@ -6154,6 +6163,20 @@ msgstr "%s n'est pas un objet valide"
msgid "the object %s does not exist"
msgstr "l'objet %s n'existe pas"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Lancez 'git remote set-head %s %s' pour suivre la modification, ou\n"
+"réglez l'option de configuration 'remote.%s.followRemoteHEAD' à une\n"
+"valeur différente si vous ne souhaitez pas voir ce message. Lancer\n"
+"spécifiquement 'git config set remote.%s.followRemoteHEAD %s'\n"
+"va désactiver l'alerte jusqu'à ce que le distant change HEAD."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "branches multiples détectées, imcompatible avec --set-upstream"
@@ -6294,6 +6317,9 @@ 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 "revision"
+msgstr "révision"
+
msgid "report that we have only objects reachable from this object"
msgstr "rapporte que nous n'avons que des objets joignables depuis cet objet"
@@ -6351,8 +6377,8 @@ msgid "protocol does not support --negotiate-only, exiting"
msgstr "Le protocole ne prend pas en charge --negotiate-only, abandon"
msgid ""
-"--filter can only be used with the remote configured in extensions."
-"partialclone"
+"--filter can only be used with the remote configured in "
+"extensions.partialclone"
msgstr ""
"--filter ne peut être utilisé qu'avec le dépôt distant configuré dans "
"extensions.partialclone"
@@ -6450,7 +6476,7 @@ msgid "config key storing a list of repository paths"
msgstr "clé de config qui stocke la liste des chemins de dépôts"
msgid "keep going even if command fails in a repository"
-msgstr "continuer mêm si la commande échoue dans un dépôt"
+msgstr "continuer même si la commande échoue dans un dépôt"
msgid "missing --config=<config>"
msgstr "--config=<config> manquant"
@@ -6665,7 +6691,7 @@ msgid "check only connectivity"
msgstr "ne vérifier que la connectivité"
msgid "enable more strict checking"
-msgstr "activer une vérification plus strict"
+msgstr "activer une vérification plus stricte"
msgid "write dangling objects in .git/lost-found"
msgstr "écrire les objets en suspens dans .git/lost-found"
@@ -6866,7 +6892,7 @@ msgstr ""
msgid ""
"There are too many unreachable loose objects; run 'git prune' to remove them."
msgstr ""
-"Il y a trop d'objets seuls inaccessibles ; lancez 'git prune' pour les "
+"Il y a trop d'objets esseulés inaccessibles ; lancez 'git prune' pour les "
"supprimer."
msgid ""
@@ -7027,9 +7053,27 @@ msgstr "ni les minuteurs systemd ni crontab ne sont disponibles"
msgid "%s scheduler is not available"
msgstr "le planificateur %s n'est pas disponible"
-msgid "another process is scheduling background maintenance"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"impossible de créer '%s.lock' : %s.\n"
+"\n"
+"Il semble qu'un processus git-maintenance(1) programmé est déjà lancé dans\n"
+"ce dépôt. Veuillez vous assurer qu'aucun processus de maintenance n'est "
+"lancé\n"
+"et réessayez. Si l'échec persiste, un processus git-maintenance(1) peut "
+"avoir\n"
+"planté dans ce dépôt : supprimez le fichier manuellement pour poursuivre."
+
+msgid "cannot acquire lock for scheduled background maintenance"
msgstr ""
-"un autre processus est en train de programmer une maintenance en tâche de "
+"impossible d'acquérir le verrou pour une maintenance programmée en tâche de "
"fond"
msgid "git maintenance start [--scheduler=<scheduler>]"
@@ -7610,6 +7654,22 @@ msgid_plural "chain length = %d: %lu objects"
msgstr[0] "longueur chaînée = %d : %lu objet"
msgstr[1] "longueur chaînée = %d : %lu objets"
+msgid "could not start pack-objects to repack local links"
+msgstr ""
+"impossible de démarrer pack-objects pour ré-empaqueter les liens locaux"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "échéc de la fourniture les objets locaux à pack-objects"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack : attente de lignes d'Id d'objets en hexa complet seulement "
+"depuis les objects de paquet."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr ""
+"impossible de terminer pack-objects pour ré-empaqueter les objets locaux"
+
msgid "Cannot come back to cwd"
msgstr "Impossible de revenir au répertoire de travail courant"
@@ -7621,6 +7681,9 @@ msgstr "mauvais %s"
msgid "unknown hash algorithm '%s'"
msgstr "algorithme d'empreinte inconnu '%s'"
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor ne peut pas être utilisé avec un nom de paquet"
+
msgid "--stdin requires a git repository"
msgstr "--stdin requiert un dépôt git"
@@ -7890,7 +7953,7 @@ msgid "base commit shouldn't be in revision list"
msgstr "le commit de base ne devrait pas faire partie de la liste de révisions"
msgid "cannot get patch id"
-msgstr "impossible d'obtenir l'id du patch"
+msgstr "impossible d'obtenir l'id de la rustine"
msgid "failed to infer range-diff origin of current series"
msgstr ""
@@ -7903,13 +7966,13 @@ msgstr ""
"utilisation de '%s' comme une différence d'intervalle pour la série actuelle"
msgid "use [PATCH n/m] even with a single patch"
-msgstr "utiliser [PATCH n/m] même avec un patch unique"
+msgstr "utiliser [PATCH n/m] même avec une rustine unique"
msgid "use [PATCH] even with multiple patches"
-msgstr "utiliser [PATCH] même avec des patchs multiples"
+msgstr "utiliser [PATCH] même avec des rustines multiples"
msgid "print patches to standard out"
-msgstr "afficher les patchs sur la sortie standard"
+msgstr "afficher les rustines sur la sortie standard"
msgid "generate a cover letter"
msgstr "générer une lettre de motivation"
@@ -7925,7 +7988,7 @@ msgid "use <sfx> instead of '.patch'"
msgstr "utiliser <sfx> au lieu de '.patch'"
msgid "start numbering patches at <n> instead of 1"
-msgstr "démarrer la numérotation des patchs à <n> au lieu de 1"
+msgstr "démarrer la numérotation des rustines à <n> au lieu de 1"
msgid "reroll-count"
msgstr "reroll-count"
@@ -7969,10 +8032,10 @@ msgid "output all-zero hash in From header"
msgstr "écrire une empreinte à zéro dans l'entête From"
msgid "don't include a patch matching a commit upstream"
-msgstr "ne pas inclure un patch correspondant à un commit amont"
+msgstr "ne pas inclure de rustine correspondant à un commit amont"
msgid "show patch format instead of default (patch + stat)"
-msgstr "afficher le format du patch au lieu du défaut (patch + stat)"
+msgstr "afficher le format de la rustine au lieu du défaut (rustine + stat)"
msgid "Messaging"
msgstr "Communication"
@@ -8009,10 +8072,10 @@ msgid "boundary"
msgstr "limite"
msgid "attach the patch"
-msgstr "attacher le patch"
+msgstr "attacher la rustine"
msgid "inline the patch"
-msgstr "patch à l'intérieur"
+msgstr "incorporer la rustine à l'intérieur"
msgid "enable message threading, styles: shallow, deep"
msgstr ""
@@ -8028,17 +8091,17 @@ msgid "base-commit"
msgstr "commit-de-base"
msgid "add prerequisite tree info to the patch series"
-msgstr "ajouter un arbre prérequis à la série de patchs"
+msgstr "ajouter un arbre prérequis à la série de rustines"
msgid "add a signature from a file"
msgstr "ajouter une signature depuis un fichier"
msgid "don't print the patch filenames"
-msgstr "ne pas afficher les noms de fichiers des patchs"
+msgstr "ne pas afficher les noms de fichiers des rustines"
msgid "show progress while generating patches"
msgstr ""
-"afficher la barre de progression durant la phase de génération des patchs"
+"afficher la barre de progression durant la phase de génération des rustines"
msgid "show changes against <rev> in cover letter or single patch"
msgstr ""
@@ -8103,7 +8166,7 @@ msgid "unable to read signature file '%s'"
msgstr "lecture du fichier de signature '%s' impossible"
msgid "Generating patches"
-msgstr "Génération des patchs"
+msgstr "Génération des rustines"
msgid "failed to create output files"
msgstr "échec de création des fichiers en sortie"
@@ -8221,7 +8284,7 @@ msgid ""
" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
" [--symref] [<repository> [<patterns>...]]"
msgstr ""
-"git ls-remote [--brances] [--tags] [--refs] [--upload-pack=<exec>]\n"
+"git ls-remote [--branches] [--tags] [--refs] [--upload-pack=<exec>]\n"
" [-q | --quiet] [--exit-code] [--get-url] [--sort=<clé>]\n"
" [--symref] [<dépôt> [<motif>...]]"
@@ -9007,11 +9070,11 @@ msgstr "git notes [--ref <références-notes>] [list [<object>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <référence-notes>] add [-f] [--allow-empty] [--"
"[no-]separator|--separator=<coupure-paragraphe>] [--[no-]stripspace] [-m "
-"<message> | -F <fichier> | (-c | -C) <objet>] [<objet>]"
+"<message> | -F <fichier> | (-c | -C) <objet>] [<objet>] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
@@ -9020,11 +9083,11 @@ msgstr ""
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <références-notes>] append [--allow-empty] [--"
"[no-]separator|--separator=<coupure-paragraphe>] [--[no-]stripspace]-m "
-"<message> | -F <fichier> | (-c | -C) <objet>] [<objet>]"
+"<message> | -F <fichier> | (-c | -C) <objet>] [<objet>] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <références-notes>] edit [--allow-empty] [<objet>]"
@@ -9143,6 +9206,9 @@ msgstr "contenu de la note dans un fichier"
msgid "reuse and edit specified note object"
msgstr "réutiliser et éditer l'objet de note spécifié"
+msgid "edit note message in editor"
+msgstr "éditer le message de node dans un éditeur"
+
msgid "reuse specified note object"
msgstr "réutiliser l'objet de note spécifié"
@@ -9652,6 +9718,9 @@ msgstr "gestion des objets manquants"
msgid "do not pack objects in promisor packfiles"
msgstr "ne pas empaqueter les objets dans les fichiers paquets prometteurs"
+msgid "implies --missing=allow-any"
+msgstr "implique --missing=allow-any"
+
msgid "respect islands during delta compression"
msgstr "respecter les îlots pendant la compression des deltas"
@@ -10064,8 +10133,8 @@ msgstr ""
msgid ""
"You didn't specify any refspecs to push, and push.default is \"nothing\"."
msgstr ""
-"Vous n'avez pas spécifié de spécifications de référence à pousser, et push."
-"default est \"nothing\"."
+"Vous n'avez pas spécifié de spécifications de référence à pousser, et "
+"push.default est \"nothing\"."
#, c-format
msgid ""
@@ -10548,7 +10617,7 @@ msgid "continue"
msgstr "continuer"
msgid "skip current patch and continue"
-msgstr "sauter le patch courant et continuer"
+msgstr "sauter la rustine courante et continuer"
msgid "abort and check out the original branch"
msgstr "abandonner et extraire la branche d'origine"
@@ -10560,7 +10629,7 @@ msgid "edit the todo list during an interactive rebase"
msgstr "éditer la liste à faire lors d'un rebasage interactif"
msgid "show the patch file being applied or merged"
-msgstr "afficher le patch en cours d'application ou de fusion"
+msgstr "afficher la rustine en cours d'application ou de fusion"
msgid "use apply strategies to rebase"
msgstr "utiliser des stratégies d'application pour rebaser"
@@ -10943,7 +11012,7 @@ msgid "repository already uses '%s' format"
msgstr "le dépôt utilise déjà le format '%s'"
msgid "enable strict checking"
-msgstr "activer une vérification plus strict"
+msgstr "activer une vérification plus stricte"
msgid "'git refs verify' takes no arguments"
msgstr "'git refs verify' n'accepte aucun argument"
@@ -11287,6 +11356,30 @@ msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " Référence locale configurée pour 'git push'%s :"
msgstr[1] " Références locales configurées pour 'git push'%s :"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "'%s/HEAD' est inchangé et pointe sur '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' a changé depuis '%s' et pointe à présent sur '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "'%s/HEAD' a été créé et pointe sur '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' est détaché de '%s' et pointe à présent sur '%s'\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"'%s/HEAD' pointait sur '%s' (qui n'est pas une branche distante), mais "
+"pointe à présent sur '%s'\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "définir refs/remotes/<nom>/HEAD selon la distante"
@@ -11310,7 +11403,7 @@ msgid "Not a valid ref: %s"
msgstr "Référence non valide : %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "Impossible de paramétrer %s"
#, c-format
@@ -12454,7 +12547,7 @@ msgid ""
"directory '%s' contains untracked files, but is not in the sparse-checkout "
"cone"
msgstr ""
-"le dossier '%s' contient des fichiers non-suivis, mais n'est pas dans le "
+"le répertoire '%s' contient des fichiers non-suivis, mais n'est pas dans le "
"cone d'extraction clairsemée"
#, c-format
@@ -13191,7 +13284,7 @@ msgid ""
"the superproject is not on any branch"
msgstr ""
"La branche du sous-module %s est configurée pour hériter de la branche du "
-"superprojet, mais le superprojet n'est sur aucune branche"
+"super-projet, mais le super-projet n'est sur aucune branche"
#, c-format
msgid "Unable to find current revision in submodule path '%s'"
@@ -14097,6 +14190,9 @@ msgstr "régler le mode de suivi (voir git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "essayer de nommer la nouvelle branche comme la branche amont"
+msgid "use relative paths for worktrees"
+msgstr "utiliser des chemins relatifs pour les arbres-de-travail"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "les options '%s', '%s' et '%s' ne peuvent pas être utilisées ensemble"
@@ -14379,6 +14475,26 @@ msgstr "impossible de créer '%s'"
msgid "index-pack died"
msgstr "l'index de groupe a disparu"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "Le répertoire '%s' est présent dans l'index et pourtant pas clairsemé"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "l'arbre de cache corrompu a des entrées non présentes dans l'index"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s avec les drapeaux 0x%x ne devrait pas être dans l'arbre de cache"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "mauvais sous-arbre '%.*s'"
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr ""
+"l'arbre de cache pour le chemin %.*s ne correspond pas. %s attendu, %s obtenu"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "l'identifiant de terminaison de tronçon apparaît plus tôt qu'attendu"
@@ -14409,13 +14525,13 @@ msgid "Add file contents to the index"
msgstr "Ajouter le contenu de fichiers dans l'index"
msgid "Apply a series of patches from a mailbox"
-msgstr "Appliquer une série de patchs depuis une boîte mail"
+msgstr "Appliquer une série de rustines depuis une boîte mail"
msgid "Annotate file lines with commit information"
msgstr "Annoter les lignes du fichier avec l'information de commit"
msgid "Apply a patch to files and/or to the index"
-msgstr "Appliquer une patch à des fichiers ou à l'index"
+msgstr "Appliquer une rustine à des fichiers ou à l'index"
msgid "Import a GNU Arch repository into Git"
msgstr "Importer dans Git un dépôt GNU Arch"
@@ -14567,7 +14683,7 @@ msgid "Run a Git command on a list of repositories"
msgstr "Lance une commande Git sur une liste de dépôts"
msgid "Prepare patches for e-mail submission"
-msgstr "Préparer les patchs pour soumission par courriel"
+msgstr "Préparer les rustines pour soumission par courriel"
msgid "Verifies the connectivity and validity of the objects in the database"
msgstr ""
@@ -14637,7 +14753,7 @@ msgstr "Afficher le contenu d'un objet arbre"
msgid "Extracts patch and authorship from a single e-mail message"
msgstr ""
-"Extraire le patch et l'information de d'auteur depuis un simple message de "
+"Extraire la rustine et l'information de l'auteur depuis un simple message de "
"courriel"
msgid "Simple UNIX mbox splitter program"
@@ -14700,7 +14816,7 @@ msgid "Pack heads and tags for efficient repository access"
msgstr "Empaqueter les têtes et les étiquettes pour un accès efficace au dépôt"
msgid "Compute unique ID for a patch"
-msgstr "Calculer l'ID unique d'un patch"
+msgstr "Calculer l'ID unique d'une rustine"
msgid "Prune all unreachable objects from the object database"
msgstr "Élaguer les objets inatteignables depuis la base de données des objets"
@@ -14775,7 +14891,7 @@ msgid "Remove files from the working tree and from the index"
msgstr "Supprimer des fichiers de la copie de travail et de l'index"
msgid "Send a collection of patches as emails"
-msgstr "Envoyer un ensemble de patchs comme courriels"
+msgstr "Envoyer un ensemble de rustines comme courriels"
msgid "Push objects over Git protocol to another repository"
msgstr "Pousser les objets sur un autre dépôt via le protocole Git"
@@ -15060,7 +15176,7 @@ msgid ""
"disabling Bloom filters for commit-graph layer '%s' due to incompatible "
"settings"
msgstr ""
-"désactivation des filtres de Bloom opur la couche de graphe de commits '%s' "
+"désactivation des filtres de Bloom pour la couche de graphe de commits '%s' "
"à cause de réglages incompatibles"
msgid "commit-graph has no base graphs chunk"
@@ -15202,8 +15318,8 @@ msgid ""
"attempting to write a commit-graph, but 'commitGraph.changedPathsVersion' "
"(%d) is not supported"
msgstr ""
-"essai d'écriture de graphe de commits, mais 'commitGraph."
-"changedPathsVersion' (%d) n'est pas pris en charge"
+"essai d'écriture de graphe de commits, mais "
+"'commitGraph.changedPathsVersion' (%d) n'est pas pris en charge"
msgid "too many commits to write graph"
msgstr "trop de commits pour écrire un graphe"
@@ -15292,13 +15408,13 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Le support de <GIT_DIR>/info/grafts est déconseillé\n"
"et sera supprimé dans une version future de Git.\n"
"\n"
"Veuillez utiliser \"git replace --convert-graft-file\"\n"
-"pour convertir les grafts en référence de remplacement.\n"
+"pour convertir les grafts en références de remplacement.\n"
"\n"
"Supprimez ce message en lançant\n"
"\"git config advice.graftFileDeprecated false\""
@@ -16139,6 +16255,18 @@ msgstr "l'url n'a pas de schéma : %s"
msgid "credential url cannot be parsed: %s"
msgstr "impossible d'analyser l'url d'identification : %s"
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "délai d'attente invalide '%s', entier positif ou nul attendu"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr "délai d'attente d'init invalide '%s', entier positif ou nul attendu"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "max-connections invalide '%s', entier attendu"
+
msgid "in the future"
msgstr "dans le futur"
@@ -16211,8 +16339,8 @@ msgstr "impossible de charger la regex île pour '%s' : %s"
#, c-format
msgid "island regex from config has too many capture groups (max=%d)"
msgstr ""
-"l'expression rationnelle depuis la configuration a trop de groupes de "
-"capture (max=%d)"
+"l'expression régulière depuis la configuration a trop de groupes de capture "
+"(max=%d)"
#, c-format
msgid "Marked %d islands, done.\n"
@@ -16735,8 +16863,7 @@ msgstr ""
"ou -G"
msgid "treat <string> in -S as extended POSIX regular expression"
-msgstr ""
-"traiter <chaîne> dans -S comme une expression rationnelle POSIX étendue"
+msgstr "traiter <chaîne> dans -S comme une expression régulière POSIX étendue"
msgid "control the order in which files appear in the output"
msgstr "contrôler l'ordre dans lequel les fichiers apparaissent dans la sortie"
@@ -16880,6 +17007,20 @@ msgstr "espaces de nom de Git \"%s\""
msgid "too many args to run %s"
msgstr "trop d'arguments pour lancer %s"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Vous tentez de récupérer %s, qui est dans le graphe de commit mais pas dans "
+"la base de données des objets.\n"
+"C'est probablement du à une corruption de dépôt.\n"
+"Si vous essayez de réparer cette corruption de dépôt en re-récupérer l'objet "
+"manquant, utilisez 'git fetch --refetch' sur les objets manquants."
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack : liste superficielle attendue"
@@ -17469,11 +17610,11 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
"Le crochet '%s' a été ignoré parce qu'il n'est pas marqué comme exécutable.\n"
-"Vous pouvez désactiver cet avertissement avec `git config advice.ignoredHook "
-"false`."
+"Vous pouvez désactiver cet avertissement avec `git config set "
+"advice.ignoredHook false`."
msgid "not a git repository"
msgstr "pas un dépôt git"
@@ -17490,15 +17631,9 @@ msgstr ""
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "La délégation de commande n'est pas supporté avec cuRL < 7.22.0"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "L'épinglage de clé publique n'est pas supporté avec cuRL < 7.39.0"
-
msgid "Unknown value for http.proactiveauth"
msgstr "valeur inconnue pour http.proactiveauth"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE n'est pas supporté avec cuRL < 7.44.0"
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "Dorsale SSL '%s' non supportée. Dorsales SSL supportées :"
@@ -17688,6 +17823,10 @@ msgid "unable to format message: %s"
msgstr "impossible de formater le message : %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "taille de marqueur invalide '%s', entier attendu"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Échec de la fusion du sous-module %s (non extrait)"
@@ -18284,7 +18423,7 @@ msgstr "échec de l'écriture de l'index de multi-paquet"
msgid "cannot expire packs from an incremental multi-pack-index"
msgstr ""
-"impossible d'expirer les paquets dpuis un index multi-paquet incrémental"
+"impossible d'expirer les paquets depuis un index multi-paquet incrémental"
msgid "Counting referenced objects"
msgstr "Comptage des objets référencés"
@@ -18293,7 +18432,7 @@ msgid "Finding and deleting unreferenced packfiles"
msgstr "Recherche et effacement des fichiers paquets non-référencés"
msgid "cannot repack an incremental multi-pack-index"
-msgstr "impossible de ré-empaqueter un index multi-paquet"
+msgstr "impossible de ré-empaqueter un index multi-paquet incrémental"
msgid "could not start pack-objects"
msgstr "impossible de démarrer le groupement d'objets"
@@ -18809,7 +18948,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Git ne crée normalement jamais de référence qui se termine par 40\n"
"caractères hexa car elle serait ignorée si vous spécifiez juste\n"
@@ -18821,7 +18960,7 @@ msgstr ""
"est créée.\n"
"Veuillez examiner ces références et peut-être les supprimer. Désactivez ce "
"message\n"
-"en lançant \"git config advice.objectNameWarning false\""
+"en lançant \"git config set advice.objectNameWarning false\""
#, c-format
msgid "log for '%.*s' only goes back to %s"
@@ -18986,13 +19125,6 @@ msgstr "l'index inverse requis manque dans l'index multi-paquet"
msgid "could not open pack %s"
msgstr "impossible d'ouvrir le paquet '%s'"
-msgid "could not determine MIDX preferred pack"
-msgstr "impossible de déterminer le paquet préféré de MIDX"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "le paquet préféré (%s) est invalide"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr ""
"table de recherche en bitmap corrompue : position de triplet hors d'index"
@@ -19270,7 +19402,7 @@ msgid "use <n> digits to display object names"
msgstr "utiliser <n> chiffres pour afficher les noms des objets"
msgid "prefixed path to initial superproject"
-msgstr "chemin préfixé vers le superprojet initial"
+msgstr "chemin préfixé vers le super-projet initial"
msgid "how to strip spaces and #comments from message"
msgstr "comment éliminer les espaces et les commentaires # du message"
@@ -19484,7 +19616,7 @@ msgstr ""
msgid ""
"pseudo-merge regex from config has too many capture groups (max=%<PRIuMAX>)"
msgstr ""
-"l'expression rationnelle de pseudo-fusion a trop de groupes de capture "
+"l'expression régulière de pseudo-fusion a trop de groupes de capture "
"(max=%<PRIuMAX>)"
#, c-format
@@ -20128,18 +20260,26 @@ msgstr "le journal pour la réf %s s'arrête de manière inattendue sur %s"
msgid "log for %s is empty"
msgstr "le journal pour la réf %s est vide"
-msgid "refusing to force and skip creation of reflog"
-msgstr "refus de forcer et sauter la création du reflog"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "refus de mettre à jour une réf avec un nom cassé '%s'"
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "refus de mettre à jour le réflog pour la pseudo-réf '%s'"
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "refus de mettre à jour la pseudo-réf '%s'"
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "refus de mettre à jour le réflog avec un nom cassé '%s'"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "refus de mettre à jour une réf avec un nom cassé '%s'"
+
+msgid "refusing to force and skip creation of reflog"
+msgstr "refus de forcer et sauter la création du reflog"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "échec de update_ref pour la réf '%s' : %s"
@@ -20190,6 +20330,10 @@ msgstr ""
"normale trouvée"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "impossible de lire le fichier de référence '%s'"
+
+#, c-format
msgid "cannot open directory %s"
msgstr "impossible d'ouvrir le répertoire %s"
@@ -20321,8 +20465,8 @@ msgstr "le serveur distant a envoyé un paquet de fin de réponse inattendu"
msgid "unable to rewind rpc post data - try increasing http.postBuffer"
msgstr ""
-"impossible de rembobiner le données post rpc - essayer d'augmenter http."
-"postBuffer"
+"impossible de rembobiner le données post rpc - essayer d'augmenter "
+"http.postBuffer"
#, c-format
msgid "remote-curl: bad line length character: %.4s"
@@ -20406,6 +20550,10 @@ msgid "more than one uploadpack given, using the first"
msgstr "plus d'un uploadpack fournis, utilisation du premier"
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "valeur '%s' de followRemoteHEAD non reconnue et ignorée "
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "valeur non reconnue transfer.credentialsInUrl : '%s'"
@@ -21359,7 +21507,7 @@ msgstr "impossible d'appliquer %s... %s"
#, c-format
msgid "dropping %s %s -- patch contents already upstream\n"
-msgstr "abandon de %s %s -- le contenu de la rustine déjà en amont\n"
+msgstr "abandon de %s %s -- le contenu de la rustine est déjà en amont\n"
#, c-format
msgid "git %s: failed to read the index"
@@ -22364,6 +22512,9 @@ msgstr "le commit %s n'est pas marqué joignable"
msgid "too many commits marked reachable"
msgstr "trop de commits marqués joignables"
+msgid "could not determine MIDX preferred pack"
+msgstr "impossible de déterminer le paquet préféré de MIDX"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<options>]"
@@ -23034,6 +23185,10 @@ msgstr "fichier .git cassé"
msgid ".git file incorrect"
msgstr "fichier .git incorrect"
+msgid ".git file absolute/relative path mismatch"
+msgstr ""
+"non-correspondance entre les chemin absolu entre relatif du fichier .git"
+
msgid "not a valid path"
msgstr "pas un chemin valide"
@@ -23050,6 +23205,9 @@ msgstr "impossible de localiser le dépôt ; fichier .git cassé"
msgid "gitdir unreadable"
msgstr "gitdir non lisible"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "non-correspondance de chemin absolu/relatif de gitdir"
+
msgid "gitdir incorrect"
msgstr "gitdir incorrect"
@@ -23085,6 +23243,14 @@ msgstr "impossible de désinitialiser %s dans '%s'"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "échec de paramétrage extensions.worktreeConfig"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"impossible de mettre à jour le format de dépôt pour prendre en charge les "
+"arbres-de-travail relatifs"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "échec de modification du paramètre extensions.relativeWorktrees"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "impossible de configurer l'environnement '%s'"
@@ -23266,13 +23432,13 @@ msgid "You are in the middle of an am session."
msgstr "Vous êtes au milieu d'une session am."
msgid "The current patch is empty."
-msgstr "Le patch actuel est vide."
+msgstr "La rustine actuelle est vide."
msgid " (fix conflicts and then run \"git am --continue\")"
msgstr " (réglez les conflits puis lancez \"git am --continue\")"
msgid " (use \"git am --skip\" to skip this patch)"
-msgstr " (utilisez \"git am --skip\" pour sauter ce patch)"
+msgstr " (utilisez \"git am --skip\" pour sauter cette rustine)"
msgid ""
" (use \"git am --allow-empty\" to record this patch as an empty commit)"
@@ -23322,7 +23488,7 @@ msgid " (fix conflicts and then run \"git rebase --continue\")"
msgstr " (réglez les conflits puis lancez \"git rebase --continue\")"
msgid " (use \"git rebase --skip\" to skip this patch)"
-msgstr " (utilisez \"git rebase --skip\" pour sauter ce patch)"
+msgstr " (utilisez \"git rebase --skip\" pour sauter cette rustine)"
msgid " (use \"git rebase --abort\" to check out the original branch)"
msgstr " (utilisez \"git rebase --abort\" pour extraire la branche d'origine)"
@@ -23382,7 +23548,7 @@ msgstr ""
" (tous les conflits sont réglés : lancez \"git cherry-pick --continue\")"
msgid " (use \"git cherry-pick --skip\" to skip this patch)"
-msgstr " (utilisez \"git cherry-pick --skip\" pour sauter ce patch)"
+msgstr " (utilisez \"git cherry-pick --skip\" pour sauter cette rustine)"
msgid " (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"
msgstr " (utilisez \"git cherry-pick --abort\" pour annuler le picorage)"
@@ -23404,7 +23570,7 @@ msgid " (all conflicts fixed: run \"git revert --continue\")"
msgstr " (tous les conflits sont réglés : lancez \"git revert --continue\")"
msgid " (use \"git revert --skip\" to skip this patch)"
-msgstr " (utilisez \"git revert --skip\" pour sauter ce patch)"
+msgstr " (utilisez \"git revert --skip\" pour sauter cette rustine)"
msgid " (use \"git revert --abort\" to cancel the revert operation)"
msgstr " (utilisez \"git revert --abort\" pour annuler le rétablissement)"
@@ -23728,7 +23894,7 @@ msgid ""
"\n"
msgstr ""
"\n"
-"Aucun fichier patch spécifié !\n"
+"Aucun fichier de rustine spécifié !\n"
"\n"
#, perl-format
@@ -23748,7 +23914,7 @@ msgid ""
msgstr ""
"Les lignes commençant par \"GIT:\" seront supprimées.\n"
"Envisagez d'inclure un diffstat global ou une table des matières\n"
-"pour le patch que vous êtes en train d'écrire.\n"
+"pour la rustine que vous êtes en train d'écrire.\n"
"\n"
"Effacez le corps si vous ne souhaitez pas envoyer un résumé.\n"
@@ -23785,7 +23951,7 @@ msgid ""
"has the template subject '*** SUBJECT HERE ***'. Pass --force if you really "
"want to send.\n"
msgstr ""
-"Envoi refusé parce que le patch\n"
+"Envoi refusé parce que la rustine\n"
"\t%s\n"
"a un sujet modèle '*** SUBJECT HERE ***'. Passez --force is vous souhaitez "
"vraiment envoyer.\n"
@@ -23938,7 +24104,7 @@ msgid ""
msgstr ""
"fatal : %s : rejeté par le crochet %s\n"
"%s\n"
-"attention : aucun patch envoyé\n"
+"attention : aucune rustine envoyée\n"
#, perl-format
msgid "unable to open %s: %s\n"
@@ -23950,7 +24116,7 @@ msgid ""
"warning: no patches were sent\n"
msgstr ""
"fatal : %s : %d est plus long que 998 caractères \n"
-"attention : aucun patch envoyé\n"
+"attention : aucune rustine envoyée\n"
#, perl-format
msgid "Skipping %s with backup suffix '%s'.\n"
@@ -23961,229 +24127,6 @@ msgstr "%s sauté avec un suffix de sauvegarde '%s'.\n"
msgid "Do you really want to send %s? [y|N]: "
msgstr "Souhaitez-vous réellement envoyer %s ?[y|N] : "
-#~ msgid "revision walk setup failed\n"
-#~ msgstr "échec de la préparation du parcours des révisions\n"
-
-#, c-format
-#~ msgid "unable to parse contact: %s"
-#~ msgstr "impossible d'analyser le contact : %s"
-
#, c-format
-#~ msgid "truncating .rej filename to %.*s.rej"
-#~ msgstr "troncature du nom de fichier .rej en %.*s.rej"
-
-#~ msgid ""
-#~ "the add.interactive.useBuiltin setting has been removed!\n"
-#~ "See its entry in 'git help config' for details."
-#~ msgstr ""
-#~ "le réglage add.interactive.useBuiltin a été supprimé !\n"
-#~ "Référez-vous à cette entrée dans 'git help config' pour plus de détails."
-
-#~ msgid "git archive: Remote with no URL"
-#~ msgstr "git archive : Dépôt distant sans URL"
-
-#~ msgid "only one action at a time"
-#~ msgstr "une seule action à la fois"
-
-#~ msgid "use [RFC PATCH] instead of [PATCH]"
-#~ msgstr "utiliser [RFC PATCH] au lieu de [PATCH]"
-
-#, c-format
-#~ msgid "no URLs configured for remote '%s'"
-#~ msgstr "aucune URL configurée pour le dépôt distant '%s'"
-
-#, c-format
-#~ msgid "remote '%s' has no configured URL"
-#~ msgstr "le distant '%s' n'a pas d'URL configuré"
-
-#~ msgid ""
-#~ "Use -f if you really want to add them.\n"
-#~ "Turn this message off by running\n"
-#~ "\"git config advice.addIgnoredFile false\""
-#~ msgstr ""
-#~ "Utilisez -f si vous voulez vraiment les ajouter.\n"
-#~ "Éliminez ce message en lançant\n"
-#~ "\"git config advice.addIgnoredFile false\""
-
-#~ msgid ""
-#~ "Maybe you wanted to say 'git add .'?\n"
-#~ "Turn this message off by running\n"
-#~ "\"git config advice.addEmptyPathspec false\""
-#~ msgstr ""
-#~ "Peut-être avez-vous voulu dire 'git add .' ?\n"
-#~ "Éliminez ce message en lançant\n"
-#~ "\"git config advice.addEmptyPathspec false\""
-
-#~ msgid ""
-#~ "clean.requireForce defaults to true and neither -i, -n, nor -f given; "
-#~ "refusing to clean"
-#~ msgstr ""
-#~ "clean.requireForce à true par défaut et ni -i, -n ou -f fourni ; refus de "
-#~ "nettoyer"
-
-#, c-format
-#~ msgid "bad ls-files format: element '%s' does not start with '('"
-#~ msgstr "mauvais format ls-files : l'élément '%s' ne commence pas par '('"
-
-#, c-format
-#~ msgid "bad ls-files format: element '%s' does not end in ')'"
-#~ msgstr "mauvais format ls-files : l'élément '%s' ne se termine pas par ')'"
-
-#, c-format
-#~ msgid "bad ls-files format: %%%.*s"
-#~ msgstr "mauvais format ls-files : %%%.*s"
-
-#~ msgid "keep redundant, empty commits"
-#~ msgstr "garder les validations redondantes, vides"
-
-#~ msgid "core.commentChar should only be one ASCII character"
-#~ msgstr "core.commentChar ne devrait être qu'un unique caractère ASCII"
-
-#~ msgid ""
-#~ "--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-"
-#~ "exclude"
-#~ msgstr ""
-#~ "--bundle-uri est incompatible avec --depth, --shallow-since, et --shallow-"
-#~ "exclude"
-
-#~ msgid "--merge-base is incompatible with --stdin"
-#~ msgstr "--merge-base est incompatible avec --stdin"
-
-#~ msgid ""
-#~ "apply options are incompatible with rebase.autoSquash. Consider adding --"
-#~ "no-autosquash"
-#~ msgstr ""
-#~ "les options d'application sont incompatibles avec rebase.autoSquash. "
-#~ "Considérez l'ajout de --no-autosquash"
-
-#~ msgid "--exclude-hidden cannot be used together with --branches"
-#~ msgstr "--exclude-hidden ne peut être utilisé avec --branches"
-
-#~ msgid "--exclude-hidden cannot be used together with --tags"
-#~ msgstr "--exclude-hidden ne peut pas être utilisé avec --tags"
-
-#~ msgid "--exclude-hidden cannot be used together with --remotes"
-#~ msgstr "--exclude-hidden ne peut pas être utilisé avec --remotes"
-
-#, c-format
-#~ msgid "only one of '%s', '%s' or '%s' can be given"
-#~ msgstr "les options '%s', '%s' et '%s' sont mutuellement exclusives"
-
-#, c-format
-#~ msgid "'%s' and '%s' cannot be used together"
-#~ msgstr "'%s' et '%s' ne peuvent pas être utilisées ensemble"
-
-#, c-format
-#~ msgid "options '%s', and '%s' cannot be used together"
-#~ msgstr "les options '%s' et '%s' ne peuvent pas être utilisées ensemble"
-
-#~ msgid "<commit-ish>"
-#~ msgstr "<commit-esque>"
-
-#, c-format
-#~ msgid "%s is incompatible with %s"
-#~ msgstr "%s est incompatible avec %s"
-
-#~ msgid "unhandled options"
-#~ msgstr "options non gérées"
-
-#, c-format
-#~ msgid "options '%s=%s' and '%s=%s' cannot be used together"
-#~ msgstr ""
-#~ "les options '%s=%s' et '%s=%s' ne peuvent pas être utilisées ensemble"
-
-#, c-format
-#~ msgid "%s : incompatible with something else"
-#~ msgstr "%s est incompatible avec toute autre option"
-
-#~ msgid "Could not write patch"
-#~ msgstr "Impossible d'écrire le patch"
-
-#, c-format
-#~ msgid "Could not stat '%s'"
-#~ msgstr "Stat de '%s' impossible"
-
-#, c-format
-#~ msgid "Cannot delete branch '%s' checked out at '%s'"
-#~ msgstr "Impossible de supprimer la branche '%s' extraite dans '%s'"
-
-#~ msgid "unable to write new_index file"
-#~ msgstr "impossible d'écrire le fichier new_index"
-
-#~ msgid "do not apply config rules"
-#~ msgstr "ne pas appliquer les règles de la configuration"
-
-#~ msgid "join whitespace-continued values"
-#~ msgstr "joindre les valeurs continuées avec des caractères blancs"
-
-#~ msgid "set parsing options"
-#~ msgstr "paramètres d'analyse"
-
-#~ msgid "cannot move directory over file"
-#~ msgstr "impossible de déplacer un répertoire sur un fichier"
-
-#~ msgid "cannot use --filter without --stdout"
-#~ msgstr "impossible d'utiliser --filter sans --stdout"
-
-#~ msgid "cannot use --max-pack-size with --cruft"
-#~ msgstr "impossible d'utiliser --max-pack-size avec --cruft"
-
-#~ msgid "--strategy requires --merge or --interactive"
-#~ msgstr "--strategy requiert --merge ou --interactive"
-
-#, c-format
-#~ msgid ""
-#~ "commit-graph has generation number zero for commit %s, but non-zero "
-#~ "elsewhere"
-#~ msgstr ""
-#~ "le graphe de commit a un numéro de génération nul pour le commit %s, mais "
-#~ "non-nul ailleurs"
-
-#~ msgid "--merge-base only works with commits"
-#~ msgstr "--merge-base ne fonctionne qu'avec des commits"
-
-#~ msgid "scalar clone [<options>] [--] <repo> [<dir>]"
-#~ msgstr "scalar clone [<options>] [--] <dépôt> [<répertoire>]"
-
-#, c-format
-#~ msgid "could not rename '%s' to '%s'"
-#~ msgstr "impossible de renommer '%s' en '%s'"
-
-#, c-format
-#~ msgid "It is not possible to %s because you have unmerged files."
-#~ msgstr "%s n'est pas possible car vous avez des fichiers non fusionnés."
-
-#~ msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
-#~ msgstr ""
-#~ "ne pas passer l'option --keep-cr à git-mailsplit indépendamment de am."
-#~ "keepcr"
-
-#~ 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 ""
-#~ "Les mises à jour ont été rejetées, car la pointe de la branche\n"
-#~ "de suivi a été mise à jour depuis la dernière extraction. Intégrez\n"
-#~ "ces changements localement (par exemple 'git pull ...') avant de\n"
-#~ "forcer à nouveau une mise à jour.\n"
-
-#~ msgid "or do not fetch any tag at all (--no-tags)"
-#~ msgstr "ou ne rapatrier aucune étiquette (--no-tags)"
-
-#~ 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"
+#~ msgid "preferred pack (%s) is invalid"
+#~ msgstr "le paquet préféré (%s) est invalide"
diff --git a/po/id.po b/po/id.po
index fc34140776..3965c9e941 100644
--- 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: 2024-10-04 08:33+0700\n"
-"PO-Revision-Date: 2024-10-04 08:52+0700\n"
+"POT-Creation-Date: 2024-12-23 18:57+0000\n"
+"PO-Revision-Date: 2025-01-06 15:50+0700\n"
"Last-Translator: Bagas Sanjaya <bagasdotme@gmail.com>\n"
"Language-Team: Indonesian\n"
"Language: id\n"
@@ -755,10 +755,10 @@ msgstr "Hanya berkas biner yang berubah."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Nonaktifkan pesan ini dengan \"git config advice.%s false\""
+"Nonaktifkan pesan ini dengan \"git config set advice.%s false\""
#: advice.c
#, c-format
@@ -1670,9 +1670,10 @@ msgstr "bukan nama objek valid: %s"
msgid "not a tree object: %s"
msgstr "bukan objek pohon: %s"
-#: archive.c builtin/clone.c
-msgid "unable to checkout working tree"
-msgstr "tidak dapat men-checkout pohon kerja"
+#: archive.c
+#, c-format
+msgid "failed to unpack tree object %s"
+msgstr "gagal membuka objek pohon %s"
#: archive.c
#, c-format
@@ -3734,11 +3735,11 @@ msgstr "HEAD tidak ditemukan di bawah refs/heads!"
#: builtin/branch.c
msgid ""
-"branch with --recurse-submodules can only be used if submodule."
-"propagateBranches is enabled"
+"branch with --recurse-submodules can only be used if "
+"submodule.propagateBranches is enabled"
msgstr ""
-"cabang dengan --recurse-submodules hanya dapat digunakan jika submodule."
-"propagateBranches diaktifkan"
+"cabang dengan --recurse-submodules hanya dapat digunakan jika "
+"submodule.propagateBranches diaktifkan"
#: builtin/branch.c
msgid "--recurse-submodules can only be used to create branches"
@@ -4767,7 +4768,7 @@ msgstr "gaya konflik '%s' tidak dikenal"
msgid "perform a 3-way merge with the new branch"
msgstr "lakukan penggabungan 3 arah dengan cabang baru"
-#: builtin/checkout.c builtin/log.c parse-options.h
+#: builtin/checkout.c builtin/log.c builtin/range-diff.c parse-options.h
msgid "style"
msgstr "gaya"
@@ -4796,9 +4797,8 @@ msgid "update ignored files (default)"
msgstr "perbarui berkas yang diabaikan (default)"
#: builtin/checkout.c
-msgid "do not check if another worktree is holding the given ref"
-msgstr ""
-"jangan periksa jika pohon kerja yang lain mempunyai referensi yang diberikan"
+msgid "do not check if another worktree is using this branch"
+msgstr "jangan periksa jika pohon kerja yang lain menggunakan cabang ini"
#: builtin/checkout.c
msgid "checkout our version for unmerged files"
@@ -5179,14 +5179,13 @@ msgstr "buat klon dangkal sedalam kedalaman tersebut"
msgid "create a shallow clone since a specific time"
msgstr "buat klon dangkal sejak waktu yang disebutkan"
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/rebase.c
-#: builtin/replay.c
-msgid "revision"
-msgstr "revisi"
+#: builtin/clone.c builtin/fetch.c builtin/pull.c
+msgid "ref"
+msgstr "referensi"
#: builtin/clone.c builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "perdalam riwayat klon dangkal, tidak termasuk rev"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "perdalam riwayat klon dangkal, kecualikan referensi"
#: builtin/clone.c builtin/submodule--helper.c
msgid "clone only one branch, HEAD or --branch"
@@ -5349,6 +5348,10 @@ msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr "HEAD remote merujuk pada ref yang tidak ada, tidak dapat men-checkout"
#: builtin/clone.c
+msgid "unable to checkout working tree"
+msgstr "tidak dapat men-checkout pohon kerja"
+
+#: builtin/clone.c
msgid "unable to write parameters to config file"
msgstr "tidak dapat menulis parameter ke berkas konfigurasi"
@@ -6347,10 +6350,10 @@ msgstr ""
#: builtin/config.c
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
-"git config unset [<opsi berkas] [--all] [--value=<nilai>] [--fixed-value] "
-"<nama> <nilai>"
+"git config unset [<opsi berkas>] [--all] [--value=<nilai>] [--fixed-value] "
+"<nama>"
#: builtin/config.c
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
@@ -6907,12 +6910,8 @@ msgstr "%lu komit dilintasi\n"
#: builtin/describe.c
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"lebih dari %i tag ditemukan; %i terbaru didaftarkan\n"
-"menyerah mencari pada %s\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "dapat %i tag; menyerah mencari pada %s\n"
#: builtin/describe.c
#, c-format
@@ -7389,8 +7388,8 @@ msgstr ""
"fetch secara normal mengindikasikan cabang mana ada pembaruan terpaksa,\n"
"tapi pemeriksaan tersebut sudah dinonaktifkan. Untuk aktifkan kembali, "
"gunakan\n"
-"bendera '--show-forced-updates' atau jalankan 'git config fetch."
-"showForcedUpdates true'."
+"bendera '--show-forced-updates' atau jalankan 'git config "
+"fetch.showForcedUpdates true'."
#: builtin/fetch.c
#, c-format
@@ -7468,6 +7467,21 @@ msgid "the object %s does not exist"
msgstr "objek '%s' tidak ada"
#: builtin/fetch.c
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Jalankan 'git remote set-head %s %s' untuk mengikuti perubahan, atau setel\n"
+"opsi konfigurasi 'remote.%s.followRemoteHEAD' ke nilai yang berbeda jika\n"
+"Anda tidak ingin melihat pesan ini lagi. Secara rinci menjalakan\n"
+"'git config set remote.%s followRemoteHEAD %s' akan mematikan peringatan\n"
+"ini sampai remote mengubah HEAD ke yang lain."
+
+#: builtin/fetch.c
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "banyak cabang terdeteksi, tidak kompatibel dengan --set-upstream"
@@ -7641,6 +7655,10 @@ msgstr "peta referensi"
msgid "specify fetch refmap"
msgstr "sebutkan ambil peta referensi"
+#: builtin/fetch.c builtin/pull.c builtin/rebase.c builtin/replay.c
+msgid "revision"
+msgstr "revisi"
+
#: builtin/fetch.c builtin/pull.c
msgid "report that we have only objects reachable from this object"
msgstr ""
@@ -7711,8 +7729,8 @@ msgstr "protokol tidak mendukung --negotiate-only, keluar."
#: builtin/fetch.c
msgid ""
-"--filter can only be used with the remote configured in extensions."
-"partialclone"
+"--filter can only be used with the remote configured in "
+"extensions.partialclone"
msgstr ""
"--filter hanya dapat digunakan dengan remote yang terkonfigurasi di "
"extensions.partialclone"
@@ -8565,8 +8583,25 @@ msgid "%s scheduler is not available"
msgstr "penjadwal %s tidak tersedia"
#: builtin/gc.c
-msgid "another process is scheduling background maintenance"
-msgstr "proses lainnya sedang menjadwalkan peme"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"Tidak dapat membuat '%s.lock': %s.\n"
+"\n"
+"Sepertinya proses git-maintenance(1) lainnya berjalan pada repositori ini.\n"
+"Pastikan tidak ada proses pemeliharaan lainnya yang berjalan dan coba lagi.\n"
+"Jika masih gagal, suatu proses git-maintenance(1) bisa jadi hancur pada\n"
+"repositori ini sebelumnya: hapus berkas secara manual untuk melanjutkan."
+
+#: builtin/gc.c
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "tidak dapat memperoleh kunci untuk pemeliharran balik layar terjadwal"
#: builtin/gc.c
msgid "git maintenance start [--scheduler=<scheduler>]"
@@ -9298,6 +9333,23 @@ msgstr[0] "panjang rantai = %d: %lu objek"
msgstr[1] "panjang rantai = %d: %lu objek"
#: builtin/index-pack.c
+msgid "could not start pack-objects to repack local links"
+msgstr "tidak dapat memulai pack-objects untuk mempak ulang tautan lokal"
+
+#: builtin/index-pack.c
+msgid "failed to feed local object to pack-objects"
+msgstr "tidak dapat memasukkan objek ke pada pack-objects"
+
+#: builtin/index-pack.c
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: Mengharapkan hanya baris hex ID objek penuh daripack-objects."
+
+#: builtin/index-pack.c
+msgid "could not finish pack-objects to repack local links"
+msgstr "tidak dapat menyelesaikan pack-objects untuk mempak ulang tautan lokal"
+
+#: builtin/index-pack.c
msgid "Cannot come back to cwd"
msgstr "tidak dapat kembali ke direktori kerja saat ini"
@@ -9312,6 +9364,10 @@ msgid "unknown hash algorithm '%s'"
msgstr "algoritma hash tak dikenal '%s'"
#: builtin/index-pack.c
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor tidak dapat digunakan dengan nama pak"
+
+#: builtin/index-pack.c
msgid "--stdin requires a git repository"
msgstr "--stdin memerlukan repositori git"
@@ -11055,11 +11111,11 @@ msgstr "git notes [--ref <referensi catan>] [list [<objek>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <referensi catatan>] add [-f] [--allow-empty] [--"
"[no-]separator|--separator=<pemisah paragraf>] [--[no-]stripspace] [-m "
-"<pesan | -F <berkas> | (-c | -C) <objek>] [<objek>]"
+"<pesan> | -F <berkas> | (-c | -C) <objek>] [<objek>] [-e]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
@@ -11070,11 +11126,11 @@ msgstr ""
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <referensi catatan>] append [--alow-empty] [--"
"[no]separator|--separator=<pemisah paragraf>] [--[no-]stripspace] [-m "
-"<pesan> | -F <berkas> | (-c | -C) <objek>] [<objek>]"
+"<pesan> | -F <berkas> | (-c | -C) <objek>] [<objek>] [-e]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
@@ -11228,6 +11284,10 @@ msgid "reuse and edit specified note object"
msgstr "gunakan ulang dan sunting objek catatan yang disebutkan"
#: builtin/notes.c
+msgid "edit note message in editor"
+msgstr "sunting pesan catatan dalam penyunting"
+
+#: builtin/notes.c
msgid "reuse specified note object"
msgstr "gunakan ulang objek catatan yang disebutkan"
@@ -11857,6 +11917,10 @@ msgid "do not pack objects in promisor packfiles"
msgstr "jangan pak objek di dalam pak penjanji"
#: builtin/pack-objects.c
+msgid "implies --missing=allow-any"
+msgstr "mengimplikasikan --missing=allow-any"
+
+#: builtin/pack-objects.c
msgid "respect islands during delta compression"
msgstr "patuhi pulau selama pemampatan delta"
@@ -12269,8 +12333,8 @@ msgid ""
msgstr ""
"\n"
"Untuk menghindari konfigurasi cabang hulu otomatis ketika namanya\n"
-"tidak akan cocok dengan cabang lokal, lihat opsi 'simple' dari branch."
-"autoSetupMerge\n"
+"tidak akan cocok dengan cabang lokal, lihat opsi 'simple' dari "
+"branch.autoSetupMerge\n"
"di 'git help config'.\n"
#: builtin/push.c
@@ -13811,6 +13875,35 @@ msgstr[0] " Referensi lokal dikonfigurasi untuk 'git push'%s:"
msgstr[1] " Referensi lokal dikonfigurasi untuk 'git push'%s:"
#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "'%s/HEAD' tak berubah dan menunjuk pada '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' berubah dari '%s' dan sekarang menunjuk pada '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "'%s/HEAD' sekarang dibuat dan menunjuk pada '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "%s/HEAD' terlepas pada '%s' dan sekarang menunjuk pada '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"'%s/HEAD' dulunya menunjuk pada '%s' (yang bukan cabang remote), tetapi "
+"sekarang menunjuk pada '%s'\n"
+
+#: builtin/remote.c
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "setel refs/remotes/<nama>/HEAD tergantung remote"
@@ -13838,8 +13931,8 @@ msgstr "Bukan referensi valid: %s"
#: builtin/remote.c
#, c-format
-msgid "Could not setup %s"
-msgstr "Tidak dapat mengatur %s"
+msgid "Could not set up %s"
+msgstr "Tidak dapat menyiapkan %s"
#: builtin/remote.c
#, c-format
@@ -17247,6 +17340,10 @@ msgstr "pasang mode pelacakan (lihat git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "coba cocokkan nama cabang baru dengan sebuah cabang pelacakan remote"
+#: builtin/worktree.c
+msgid "use relative paths for worktrees"
+msgstr "gunakan jalur relatif untuk pohon kerja"
+
#: builtin/worktree.c diff.c parse-options.c
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
@@ -17588,6 +17685,31 @@ msgstr "tidak dapat membuat '%s'"
msgid "index-pack died"
msgstr "index-pack mati"
+#: cache-tree.c
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "direktori '%s' ada pada indeks, tapi bukan tipis"
+
+#: cache-tree.c unpack-trees.c
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "pohon tembolok rusak mempunyai entri yang tidak ada pada indeks"
+
+#: cache-tree.c
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s dengan bendera 0x%x tidak boleh ada di pohon tembolok"
+
+#: cache-tree.c
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "subpohon jelek '%.*s'"
+
+#: cache-tree.c
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr ""
+"pohon tembolok untuk jalur %.*s tidak cocok. %s diharapkan tapi dapat %s"
+
#: chunk-format.c
msgid "terminating chunk id appears earlier than expected"
msgstr "id bingkah pengakhiran muncul lebih awal dari yang diharapkan"
@@ -18714,16 +18836,16 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Dukungan untuk <GIT_DIR>/info/grafts usang dan akan dihapus\n"
-"pada versi Git di masa yang akan datang.\n"
+"pada versi Git mendatang.\n"
"\n"
"Mohon gunakan \"git replace --convert-graft-file\"\n"
"untuk mengkonversi cangkuk ke referensi penggantian.\n"
"\n"
"Matikan pesan ini dengan menjalankan\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
#: commit.c
#, c-format
@@ -19739,6 +19861,21 @@ msgstr "url tidak punya skema: %s"
msgid "credential url cannot be parsed: %s"
msgstr "url kredensial tidak dapat diuraikan: %s"
+#: daemon.c
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "timeout '%s' tidak valid, bilangan bulat non-negatif diharapkan"
+
+#: daemon.c
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr "init-timeout '%s' tidak valid, bilangan bulat non-negatif diharapkan"
+
+#: daemon.c
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "max-connections '%s' tidak valid, bilangan bulat diharapkan"
+
#: date.c
msgid "in the future"
msgstr "di masa depan"
@@ -20632,6 +20769,21 @@ msgid "too many args to run %s"
msgstr "terlalu banyak argumen untuk menjalankan %s"
#: fetch-pack.c
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Anda mencoba mengambil %s, yang ada di dalam berkas grafik komit tapi bukan "
+"di dalam basis data objek.\n"
+"Bisa jadi ini dikarenakan kerusakan repositori.\n"
+"Apabila Anda mencoba memperbaiki keruskanan repositori ini dengan mengambil "
+"ulang objek yang hilang, gunakan 'git fetch --refetch' dengan objek tersebut."
+
+#: fetch-pack.c
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: daftar dangkal diharapkan"
@@ -21351,11 +21503,11 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
-"Kait '%s' diabaikan karena tidak disetel sebagai dapat dieksekusi.\n"
-"Anda dapat menonaktifkan peringatan ini dengan `git config advice."
-"ignoredHook false`."
+"Kait '%s' diabaikan karena tidak disetel sebagai berkas yang dapat\n"
+"dieksekusi. Anda dapat menonaktifkan peringatan ini dengan\n"
+"`git config set advice.ignoredHook false`."
#: http-fetch.c
msgid "not a git repository"
@@ -21376,18 +21528,10 @@ msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Kontrol delegasi tidak didukung oleh cURL < 7.22.0"
#: http.c
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "Penyematan kunci publik tidak didukung oleh cURL < 7.39.0"
-
-#: http.c
msgid "Unknown value for http.proactiveauth"
msgstr "nilai tidak dikenal untuk http.proactiveauth"
#: http.c
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE tidak didukung dengan cURL < 7.44.0"
-
-#: http.c
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "Tulang punggung SSL '%s' tidak didukung, yang didukung:"
@@ -21609,6 +21753,11 @@ msgstr "CRLF terkutip terdeteksi"
msgid "unable to format message: %s"
msgstr "tidak dapat memformat pesan: %s"
+#: merge-ll.c
+#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "marker-size '%s' tidak valid, bilangan bulat diharapkan"
+
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
@@ -22955,19 +23104,17 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Biasanya Git tidak pernah membuat sebuah referensi yang diakhiri dengan\n"
-"40 karakter hex, karena akan diabaikan ketika Anda hanya menyebutkan 40-"
-"hex.\n"
+"40 karakter hex, karena akan diabaikan ketika Anda hanya merincikan 40-hex.\n"
"Referensi tersebut bisa tidak sengaja dibuat. Misalnya,\n"
"\n"
" git switch -c $br $(git rev-parse ...)\n"
"\n"
"dimana \"$br\" entah bagaimana kosong dan referensi 40-hex dibuat.\n"
-"Mohon periksa referensi tersebut dan mungkin hapus. Matikan pesan ini "
-"dengan\n"
-"menjalankan \"git config advice.objectNameWarning false\""
+"Mohon periksa referensi tersebut dan mungkin hapus. Matikan pesan ini\n"
+"dengan menjalankan \"git config set advice.objectNameWarning false\""
#: object-name.c
#, c-format
@@ -23166,15 +23313,6 @@ msgstr "bitmap multipak kehilangan indeks balik yang diperlukan"
msgid "could not open pack %s"
msgstr "tidak dapat membuka '%s'"
-#: pack-bitmap.c t/helper/test-read-midx.c
-msgid "could not determine MIDX preferred pack"
-msgstr "tidak dapat menentukan pak MIDX terpilih"
-
-#: pack-bitmap.c
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "pak yang disukai '%s' kadaluarsa"
-
#: pack-bitmap.c
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "tabel pencarian bitmap rusak: posisi kembar tiga di luar indeks"
@@ -24546,8 +24684,19 @@ msgid "log for %s is empty"
msgstr "log untuk %s kosong"
#: refs.c
-msgid "refusing to force and skip creation of reflog"
-msgstr "menolak memaksa dan melewatkan pembuatan reflog"
+#, c-format
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "menolak memperbarui reflog untuk referensi semu '%s'"
+
+#: refs.c
+#, c-format
+msgid "refusing to update pseudoref '%s'"
+msgstr "menolak memperbarui referensi semu '%s'"
+
+#: refs.c
+#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "menolak memperbarui reflog dengan nama jelek '%s'"
#: refs.c
#, c-format
@@ -24555,9 +24704,8 @@ msgid "refusing to update ref with bad name '%s'"
msgstr "menolak memperbarui referensi dengan nama jelek '%s'"
#: refs.c
-#, c-format
-msgid "refusing to update pseudoref '%s'"
-msgstr "menolak memperbarui referensi semu '%s'"
+msgid "refusing to force and skip creation of reflog"
+msgstr "menolak memaksa dan melewatkan pembuatan reflog"
#: refs.c
#, c-format
@@ -24622,6 +24770,11 @@ msgstr ""
#: refs/files-backend.c
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "tidak dapat membaca berkas referensi '%s'"
+
+#: refs/files-backend.c
+#, c-format
msgid "cannot open directory %s"
msgstr "tidak dapat membuka direktori %s"
@@ -24885,6 +25038,11 @@ msgstr "lebih dari satu paket unggah diberikan, gunakan yang pertama"
#: remote.c
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "nilai followRemoteHEAD yang tak dikenal '%s' diabaikan"
+
+#: remote.c
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "nilai transfer.credentialsInUrl tidak dikenal: '%s'"
@@ -27240,6 +27398,10 @@ msgstr "komit %s tidak ditandai sebagai dapat dicapai"
msgid "too many commits marked reachable"
msgstr "terlalu banyak komit yang ditandai sebagai dapat dicapai"
+#: t/helper/test-read-midx.c
+msgid "could not determine MIDX preferred pack"
+msgstr "tidak dapat menentukan pak MIDX terpilih"
+
#: t/helper/test-serve-v2.c
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<opsi>]"
@@ -28027,6 +28189,10 @@ msgid ".git file incorrect"
msgstr "berkas .git salah"
#: worktree.c
+msgid ".git file absolute/relative path mismatch"
+msgstr "jalur absolut/relative berkas .git tidak cocok"
+
+#: worktree.c
msgid "not a valid path"
msgstr "bukan jalur valid"
@@ -28048,6 +28214,10 @@ msgid "gitdir unreadable"
msgstr "gitdir tidak dapat dibaca"
#: worktree.c
+msgid "gitdir absolute/relative path mismatch"
+msgstr "jalur absolut/relatif gitdir tidak cocok"
+
+#: worktree.c
msgid "gitdir incorrect"
msgstr "gitdir salah"
@@ -28091,6 +28261,16 @@ msgstr "tidak dapat menyetel balik %s di '%s'"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "gagal menyetel setelan extensions.worktreeConfig"
+#: worktree.c
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"tidak dapat meningkatkan format repositori untuk mendukung pohon kerja "
+"relatif"
+
+#: worktree.c
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "gagal menyetel setelan extensions.relativeWorktrees"
+
#: wrapper.c
#, c-format
msgid "could not setenv '%s'"
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000000..d7154b6395
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,27 @@
+i18n = import('i18n')
+
+translations = i18n.gettext('git',
+ languages: [
+ 'bg',
+ 'ca',
+ 'de',
+ 'el',
+ 'es',
+ 'fr',
+ 'id',
+ 'is',
+ 'it',
+ 'ko',
+ 'pl',
+ 'pt_PT',
+ 'ru',
+ 'sv',
+ 'tr',
+ 'uk',
+ 'vi',
+ 'zh_CN',
+ 'zh_TW',
+ ],
+ install: true,
+)
+test_dependencies += translations[0]
diff --git a/po/sv.po b/po/sv.po
index 973dd940ac..5377b3ece7 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: git 2.47.0\n"
+"Project-Id-Version: git 2.48.0\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2024-09-19 02:06+0000\n"
-"PO-Revision-Date: 2024-09-28 15:45+0100\n"
+"POT-Creation-Date: 2024-12-30 11:57+0100\n"
+"PO-Revision-Date: 2024-12-30 12:03+0100\n"
"Last-Translator: Peter Krefting <peter@softwolves.pp.se>\n"
"Language-Team: Svenska <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
@@ -624,10 +624,10 @@ msgstr "Endast binära filer ändrade."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Slå av meddelandet med ”git config advice.%s false”"
+"Slå av meddelandet med ”git config set advice.%s false”"
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -1300,7 +1300,7 @@ msgstr "fel i deflate (%d)"
#, c-format
msgid "unable to start '%s' filter"
-msgstr "kane inte starta filtret ”%s”"
+msgstr "kan inte starta filtret ”%s”"
msgid "unable to redirect descriptor"
msgstr "kan inte omdirigera handtag"
@@ -1358,6 +1358,10 @@ msgid "not a tree object: %s"
msgstr "inte ett trädobjekt: %s"
#, c-format
+msgid "failed to unpack tree object %s"
+msgstr "misslyckades packa upp trädobjektet %s"
+
+#, c-format
msgid "File not found: %s"
msgstr "Hittar inte filen: %s"
@@ -2808,7 +2812,7 @@ msgstr "kunde inte slå upp HEAD"
#, c-format
msgid "HEAD (%s) points outside of refs/heads/"
-msgstr "HEAD (%s) pekar utenför refs/heads/"
+msgstr "HEAD (%s) pekar utanför refs/heads/"
#, c-format
msgid "branch %s is being rebased at %s"
@@ -2824,7 +2828,7 @@ msgstr "HEAD i arbetskatalogen %s har inte uppdaterats"
#, c-format
msgid "invalid branch name: '%s'"
-msgstr "gelaktigt namn på gren: ”%s”"
+msgstr "felaktigt namn på gren: ”%s”"
#, c-format
msgid "no commit on branch '%s' yet"
@@ -3297,7 +3301,7 @@ msgid "read commands from stdin"
msgstr "läs kommandon från standard in"
msgid "with --batch[-check]: ignores stdin, batches all known objects"
-msgstr "med --batch[-check]: ignorear standard in, buntar alla kända objekt"
+msgstr "med --batch[-check]: ignorerar standard in, buntar alla kända objekt"
msgid "Change or optimize batch output"
msgstr "Ändra eller optimera buntutdata"
@@ -3683,13 +3687,13 @@ msgid ""
"one remote, e.g. the 'origin' remote, consider setting\n"
"checkout.defaultRemote=origin in your config."
msgstr ""
-"Om du menade checka ut en spårad fjärrgren på t.ex ”origin”, kan du\n"
+"Om du menade checka ut en spårad fjärrgren på t.ex. ”origin”, kan du\n"
"göra det genom att ange hela namnet med flaggan --track:\n"
"\n"
" git checkout --track origin/<namn>\n"
"\n"
"Om du alltid vill att utcheckningar med tvetydiga <namn> ska\n"
-"föredra en fjärr, t.ex fjärren ”origin” kan du ställa in\n"
+"föredra en fjärr, t.ex. fjärren ”origin” kan du ställa in\n"
"checkout.defaultRemote=origin i din konfiguration."
#, c-format
@@ -3795,7 +3799,7 @@ msgid "Cannot switch branch to a non-commit '%s'"
msgstr "Kan inte växla gren till icke-incheckningen ”%s”"
msgid "missing branch or commit argument"
-msgstr "saknar gren- eller incheckingsargument"
+msgstr "saknar gren- eller incheckningsargument"
#, c-format
msgid "unknown conflict style '%s'"
@@ -3825,9 +3829,8 @@ msgstr "ny ofödd gren"
msgid "update ignored files (default)"
msgstr "uppdatera ignorerade filer (standard)"
-msgid "do not check if another worktree is holding the given ref"
-msgstr ""
-"kontrollera inte om en annan arbetskatalog håller den angivna referensen"
+msgid "do not check if another worktree is using this branch"
+msgstr "kontrollera inte om en annan arbetskatalog använder grenen"
msgid "checkout our version for unmerged files"
msgstr "checka ut vår version för ej sammanslagna filer"
@@ -4125,11 +4128,11 @@ msgstr "skapa en grund klon på detta djup"
msgid "create a shallow clone since a specific time"
msgstr "skapa en grund klon från en angiven tidpunkt"
-msgid "revision"
-msgstr "revision"
+msgid "ref"
+msgstr "ref"
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "fördjupa historik för grund klon, exkludera revisionen"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "fördjupa historik för grund klon, exkludera ref"
msgid "clone only one branch, HEAD or --branch"
msgstr "klona endast en gren, HEAD eller --branch"
@@ -4422,7 +4425,7 @@ msgid "the object directory to store the graph"
msgstr "objektkatalogen där grafen ska lagras"
msgid "if the commit-graph is split, only verify the tip file"
-msgstr "om inchecknignsgrafen är delad, kontrollera bara spetsfilen"
+msgstr "om incheckningsgrafen är delad, kontrollera bara spetsfilen"
#, c-format
msgid "Could not open commit-graph '%s'"
@@ -4468,7 +4471,7 @@ msgstr "tillåt skriva en inkrementell incheckningsgraffil"
msgid "maximum number of commits in a non-base split commit-graph"
msgstr ""
-"maximalt antal incheckningar i en delad incheckingsgraf som inte är bad"
+"maximalt antal incheckningar i en delad incheckningsgraf som inte är bad"
msgid "maximum ratio between two levels of a split commit-graph"
msgstr "maximalt förhållande mellan två nivåer av en delad incheckningsgraf"
@@ -4477,7 +4480,7 @@ msgid "only expire files older than a given date-time"
msgstr "låt tid endast gå ut för filer äldre än givet datum och tid"
msgid "maximum number of changed-path Bloom filters to compute"
-msgstr "maximalt antal Bloom-filer med ändrad sökväg att beräkna"
+msgstr "maximalt antal Bloom-filter med ändrad sökväg att beräkna"
msgid "use at most one of --reachable, --stdin-commits, or --stdin-packs"
msgstr "använd som mest en av --reachable, --stdin-commits och --stdin-packs"
@@ -5054,10 +5057,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
"git config unset [<filflagga>] [--all] [--value=<värde>] [--fixed-value] "
-"<namn> <värde>"
+"<namn>"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr "git config rename-section [<filflagga>] <gammalt-namn> <nytt-namn>"
@@ -5423,7 +5426,7 @@ msgstr "”credential-cache” ej tillgänglig; stöd för unix-uttag saknas"
#, c-format
msgid "unable to get credential storage lock in %d ms"
-msgstr "kan inte erhålla låset för lagring av inlogginsuppgifter på %d ms"
+msgstr "kan inte erhålla låset för lagring av inloggningsuppgifter på %d ms"
msgid ""
"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
@@ -5490,12 +5493,8 @@ msgid "traversed %lu commits\n"
msgstr "traverserade %lu incheckningar\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"mer än %i taggar hittades; listar de %i senaste\n"
-"gav upp sökningen vid %s\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "hittade %i taggar; gav upp sökning vid %s\n"
#, c-format
msgid "describe %s\n"
@@ -5783,7 +5782,7 @@ msgid "Expected 'to' command, got %s"
msgstr "Förväntade ”to”-kommando, fick %s"
msgid "Expected format name:filename for submodule rewrite option"
-msgstr "Förvändae formatet namn:filnamn för undermodul-omskrivningsflaggan"
+msgstr "Förväntade formatet namn:filnamn för undermodul-omskrivningsflaggan"
#, c-format
msgid "feature '%s' forbidden in input without --allow-unsafe-features"
@@ -5927,6 +5926,20 @@ msgstr "%s är inte ett giltigt objekt"
msgid "the object %s does not exist"
msgstr "objektet %s finns inte"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Kör ”git remote set-head %s %s” för att följa ändringen, eller sätt\n"
+"konfigurationsflaggan ”remote %s.followRemoteHEAD” till ett annat värde\n"
+"om du inte vill se det här meddelandet. Du kan specifikt inaktivera\n"
+"varningen till fjärren ändrar HEAD till något annat genom att köra\n"
+"”git config set remote %s.followRemoteHEAD %s”."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "flera grenar upptäcktes, inkompatibelt med --set-upstream"
@@ -6064,6 +6077,9 @@ msgstr "referenskarta"
msgid "specify fetch refmap"
msgstr "ange referenskarta för ”fetch”"
+msgid "revision"
+msgstr "revision"
+
msgid "report that we have only objects reachable from this object"
msgstr "rapportera att vi bara har objekt nåbara från detta objektet"
@@ -6077,7 +6093,7 @@ 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"
+msgstr "skriv incheckningsgrafen efter hämtning"
msgid "accept refspecs from stdin"
msgstr "ta emot referenser från standard in"
@@ -6125,7 +6141,7 @@ msgid "--atomic can only be used when fetching from one remote"
msgstr "--atomic kan bara användas vid hämtning från en fjärr"
msgid "--stdin can only be used when fetching from one remote"
-msgstr "--stdin kan bara användas vid hämtning fårn en fjärr"
+msgstr "--stdin kan bara användas vid hämtning från en fjärr"
msgid ""
"git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"
@@ -6422,7 +6438,7 @@ msgid "report root nodes"
msgstr "rapportera rotnoder"
msgid "make index objects head nodes"
-msgstr "gör indexojekt till huvudnoder"
+msgstr "gör indexobjekt till huvudnoder"
msgid "make reflogs head nodes (default)"
msgstr "gör refloggar till huvudnoder (standard)"
@@ -6789,8 +6805,25 @@ msgstr "varken systemd-timer eller crontab är tillgänglig"
msgid "%s scheduler is not available"
msgstr "%s-schemaläggare är inte tillgänglig"
-msgid "another process is scheduling background maintenance"
-msgstr "en annan process schemalägger bakgrundsunderhåll"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"Kunde inte skapa ”%s.lock”: %s.\n"
+"\n"
+"Det verkar som en annan schemalagd git-maintenance(1)-process kör i det\n"
+"här arkivet. Se till att inga andra underhållsprocesser körs och försök\n"
+"sedan igen. Om det fortfarande misslyckas kanske en git-maintenance(1)-\n"
+"process har kraschat i det här arkivet tidigare: ta bort filen manuellt\n"
+"för att fortsätta."
+
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "kan inte erhålla låset för schemalagt bakgrundsunderhåll"
msgid "git maintenance start [--scheduler=<scheduler>]"
msgstr "git maintenance start [--scheduler=<schemaläggare>]"
@@ -7320,7 +7353,7 @@ msgstr "paketfilnamnet ”%s” slutar inte med ”.%s”"
#, c-format
msgid "cannot write %s file '%s'"
-msgstr "kan inte ta skriva %s-fil ”%s”"
+msgstr "kan inte skriva %s-fil ”%s”"
#, c-format
msgid "cannot close written %s file '%s'"
@@ -7357,6 +7390,19 @@ msgid_plural "chain length = %d: %lu objects"
msgstr[0] "kedjelängd = %d: %lu objekt"
msgstr[1] "kedjelängd = %d: %lu objekt"
+msgid "could not start pack-objects to repack local links"
+msgstr "kunde inte starta pack-objects för att packa om lokala länkar"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "misslyckades sända lokala objekt till pack-objects"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: Förväntar kompletta hex-objekt-ID-rader endast från pack-objects."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr "kunde inte avsluta pack-objects för att packa om lokala länkar"
+
msgid "Cannot come back to cwd"
msgstr "Kan inte gå tillbaka till arbetskatalogen (cwd)"
@@ -7368,6 +7414,9 @@ msgstr "felaktig %s"
msgid "unknown hash algorithm '%s'"
msgstr "okänd hashningsalgoritm ”%s”"
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor kan inte användas med ett paketnamn"
+
msgid "--stdin requires a git repository"
msgstr "--stdin kräver ett git-arkiv"
@@ -7683,7 +7732,7 @@ msgid "cover-from-description-mode"
msgstr "cover-from-description-läge"
msgid "generate parts of a cover letter based on a branch's description"
-msgstr "skapa delar av omslagsbrevet baserat på grenbeskrivelsen"
+msgstr "skapa delar av omslagsbrevet baserat på grenbeskrivningen"
msgid "use branch description from file"
msgstr "använd grenbeskrivningar från fil"
@@ -7925,7 +7974,7 @@ msgid "show debugging data"
msgstr "visa felsökningsutdata"
msgid "suppress duplicate entries"
-msgstr "undertyck dublettposter"
+msgstr "undertryck dublettposter"
msgid "show sparse directories in the presence of a sparse index"
msgstr "visa glesa kataloger när et glest index existerar"
@@ -8017,7 +8066,7 @@ msgid "keep subject"
msgstr "behåll ärenderad"
msgid "keep non patch brackets in subject"
-msgstr "behåll hakparanterser som inte är ”patch” i ärenderaden"
+msgstr "behåll hakparenteser som inte är ”patch” i ärenderaden"
msgid "copy Message-ID to the end of commit message"
msgstr "kopiera Message-ID till slutet av incheckningsmeddelandet"
@@ -8172,7 +8221,7 @@ msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
msgstr "git merge-tree [--write-tree] [<flaggor>] <gren1> <gren2>"
msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
-msgstr "git merge-tree [--trivial-merge] <baseträd> <gren1> <gren2>"
+msgstr "git merge-tree [--trivial-merge] <basträd> <gren1> <gren2>"
msgid "do a real merge instead of a trivial merge"
msgstr "gör en riktig sammanslagning istället för en enkel sammanslagning"
@@ -8708,11 +8757,11 @@ msgstr "git notes [--ref <anteckningsref>] [list [<objekt>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <anteckningsref>] add [-f] [--allow-empty] [--"
"[no-]separator|--separator=<styckebrytning>] [--[no-]stripspace] [-m <medd> "
-"| -F <fil> | (-c | -C) <objekt>] [<objekt>]"
+"| -F <fil> | (-c | -C) <objekt>] [<objekt>] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
@@ -8721,11 +8770,11 @@ msgstr ""
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <anteckningsref>] append [--allow-empty] [--"
"[no-]separator|--separator=<styckebrytning>] [--[no-]stripspace] [-m <medd> "
-"| -F <fil> | (-c | -C) <objekt>] [<objekt>]"
+"| -F <fil> | (-c | -C) <objekt>] [<objekt>] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <anteckningsref>] edit [--allow-empty] [<objekt>]"
@@ -8844,6 +8893,9 @@ msgstr "anteckningsinnehåll i en fil"
msgid "reuse and edit specified note object"
msgstr "återanvänd och redigera angivet anteckningsobjekt"
+msgid "edit note message in editor"
+msgstr "redigera anteckning i textredigeringsprogram"
+
msgid "reuse specified note object"
msgstr "återanvänd angivet anteckningsobjekt"
@@ -9192,7 +9244,7 @@ msgstr "kan inte öppna paketfilen"
#, c-format
msgid "loose object at %s could not be examined"
-msgstr "lösa objekt på %s kunde inte underökas"
+msgstr "lösa objekt på %s kunde inte undersökas"
msgid "unable to force loose object"
msgstr "kan inte tvinga lösa objekt"
@@ -9336,6 +9388,9 @@ msgstr "hantering av saknade objekt"
msgid "do not pack objects in promisor packfiles"
msgstr "packa inte objekt i kontraktspackfiler"
+msgid "implies --missing=allow-any"
+msgstr "implicerar --missing=allow-any"
+
msgid "respect islands during delta compression"
msgstr "respektera öar under deltakomprimering"
@@ -9638,7 +9693,7 @@ msgid "Need to specify how to reconcile divergent branches."
msgstr "Måste ange hur avvikande grenar skall förlikas."
msgid "cannot rebase with locally recorded submodule modifications"
-msgstr "kan inte ombasera med lokalt lagrade ändringar i undermoful"
+msgstr "kan inte ombasera med lokalt lagrade ändringar i undermodul"
msgid "git push [<options>] [<repository> [<refspec>...]]"
msgstr "git push [<flaggor>] [<arkiv> [<refspec>...]]"
@@ -10156,7 +10211,7 @@ msgid "empty exec command"
msgstr "tomt exec-kommando"
msgid "rebase onto given branch instead of upstream"
-msgstr "ombasera mot given grenen istället för uppström"
+msgstr "ombasera mot given gren istället för uppström"
msgid "use the merge-base of upstream and branch as the current base"
msgstr "använd sammanslagningsbasen mellan uppströms och gren som aktuell bas"
@@ -10548,7 +10603,7 @@ msgid "process the reflogs of all references"
msgstr "hantera referensloggar för alla referenser"
msgid "limits processing to reflogs from the current worktree only"
-msgstr "begränsar hantering av referensloggar till endst aktuell arbetskatalog"
+msgstr "begränsar hantering av referensloggar till endast aktuell arbetskatalog"
#, c-format
msgid "Marking reachable objects..."
@@ -10919,6 +10974,30 @@ msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " Lokal referens konfigurerad för ”git push”%s:"
msgstr[1] " Lokala referenser konfigurerade för ”git push”%s:"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "”%s/HEAD” är oförändrad och pekar på ”%s”\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "”%s/HEAD” har ändrats från ”%s” och pekar nu på ”%s”\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "”%s/HEAD” har nu skapats och pekar på ”%s”\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "”%s/HEAD” kopplades från vid ”%s” och pekar nu på ”%s”\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"”%s/HEAD” pekade tidigare på ”%s” (som inte är en fjärrgren), men pekar nu "
+"på ”%s”\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "sätt refs/remotes/<namn>/HEAD enligt fjärren"
@@ -10940,7 +11019,7 @@ msgid "Not a valid ref: %s"
msgstr "Inte en giltig referens: %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "Kunde inte ställa in %s"
#, c-format
@@ -11787,7 +11866,7 @@ msgstr "Ingen sökvägsangivelse gavs. Vilka filer ska jag ta bort?"
msgid "please stage your changes to .gitmodules or stash them to proceed"
msgstr ""
-"löa dina ändringar i .gitmodules eller använd ”stash” för att fortsätta"
+"köa dina ändringar i .gitmodules eller använd ”stash” för att fortsätta"
#, c-format
msgid "not removing '%s' recursively without -r"
@@ -11861,7 +11940,7 @@ msgid "linewrap output"
msgstr "radbryt utdata"
msgid "field"
-msgstr "föt"
+msgstr "fält"
msgid "group by field"
msgstr "gruppera efter fält"
@@ -12022,7 +12101,7 @@ msgid "stricter reference checking, requires exact ref path"
msgstr "striktare referenskontroll, kräver exakt referenssökväg"
msgid "show the HEAD reference, even if it would be filtered out"
-msgstr "visa HEAD-refrens, även när den skulle filtreras ut"
+msgstr "visa HEAD-referens, även när den skulle filtreras ut"
msgid "dereference tags into object IDs"
msgstr "avreferera taggar till objekt-id"
@@ -12079,7 +12158,7 @@ msgid "initialize the sparse-checkout in cone mode"
msgstr "initiera sparse-checkout i konläge"
msgid "toggle the use of a sparse index"
-msgstr "slå på/av använding av glest index"
+msgstr "slå på/av användning av glest index"
#, c-format
msgid "unable to create leading directories of %s"
@@ -12250,7 +12329,7 @@ msgstr "Inga ”stash”-poster hittades."
#, c-format
msgid "%s is not a valid reference"
-msgstr "%s är inte en giltigt referens"
+msgstr "%s är inte en giltig referens"
msgid "git stash clear with arguments is unimplemented"
msgstr "”git stash clear” med argument har inte implementerats"
@@ -12501,7 +12580,7 @@ msgstr ""
"HEAD"
msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
-msgstr "git submodule status [--quitet] [--cached] [--recursive] [<sökväg>...]"
+msgstr "git submodule status [--quiet] [--cached] [--recursive] [<sökväg>...]"
#, c-format
msgid "* %s %s(blob)->%s(submodule)"
@@ -12524,7 +12603,7 @@ msgid "unexpected mode %o"
msgstr "okänt läge %o"
msgid "use the commit stored in the index instead of the submodule HEAD"
-msgstr "använd incechkning lagrad i indexet istället för undermodulens HEAD"
+msgstr "använd incheckning lagrad i indexet istället för undermodulens HEAD"
msgid "compare the commit in the index with that in the submodule HEAD"
msgstr "jämför incheckningen i indexet med den i undermodulens HEAD"
@@ -13641,6 +13720,9 @@ msgstr "ställ in spårningsläge (se git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "försök träffa namn på ny gren mot en fjärrspårande gren"
+msgid "use relative paths for worktrees"
+msgstr "använd relativa sökvägar för arbetskataloger"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "flaggorna ”%s”, ”%s” och ”%s” kan inte användas samtidigt"
@@ -13802,7 +13884,7 @@ msgstr "misslyckades lagra maximal skaparsymbol"
#, c-format
msgid "unrecognized bundle mode from URI '%s'"
-msgstr "okänt buntlägre från URI:en ”%s”"
+msgstr "okänt buntläge från URI:en ”%s”"
#, c-format
msgid "exceeded bundle URI recursion limit (%d)"
@@ -13912,6 +13994,26 @@ msgstr "kan inte skapa ”%s”"
msgid "index-pack died"
msgstr "index-pack dog"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "katalogen ”%s” finns i indexet, men inte glest"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "trasigt cacheträd innehåller poster som inte finns i indexet"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s med flaggorna 0x%x borde inte finnas i cacheträdet"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "felaktigt underträd ”%.*s”"
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr ""
+"cacheträd för sökvägen %.*s stämmer inte överens. Förväntade %s fick %s"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "avslutande stycke-id förekommer tidigare än förväntat"
@@ -14131,7 +14233,7 @@ msgid "Send a collection of patches from stdin to an IMAP folder"
msgstr "Sänd en samling patchar från stdin till en IMAP-mapp"
msgid "Build pack index file for an existing packed archive"
-msgstr "SKapa pack-indexfiler för ett befintligt packat arkiv"
+msgstr "Skapa pack-indexfiler för ett befintligt packat arkiv"
msgid "Create an empty Git repository or reinitialize an existing one"
msgstr "Skapa tomt Git-arkiv eller ominitiera ett befintligt"
@@ -14353,7 +14455,7 @@ msgid "Creates a temporary file with a blob's contents"
msgstr "Skapar temporära filer med innehållet från en blob"
msgid "Unpack objects from a packed archive"
-msgstr "Packa upp objekt från ett pakat arkiv"
+msgstr "Packa upp objekt från ett packat arkiv"
msgid "Register file contents in the working tree to the index"
msgstr "Registrera filinnehållet från arbetskatalogen i indexet"
@@ -14410,7 +14512,7 @@ msgid "Git for CVS users"
msgstr "Git för CVS-användare"
msgid "Tweaking diff output"
-msgstr "Justrea diff-utdata"
+msgstr "Justera diff-utdata"
msgid "A useful minimum set of commands for Everyday Git"
msgstr "Ett användbart minsta uppsättning kommandon för vardags-Git"
@@ -14518,7 +14620,7 @@ msgid "commit-graph generations chunk is wrong size"
msgstr "incheckningsgrafens generationsstycke har fel storlek"
msgid "commit-graph changed-path index chunk is too small"
-msgstr "incheckningsgrafens ändrade-sökvägar-indexstycke är förö litet"
+msgstr "incheckningsgrafens ändrade-sökvägar-indexstycke är för litet"
#, c-format
msgid ""
@@ -14582,10 +14684,10 @@ msgstr "incheckningsgrafens kedjefil är för liten"
#, c-format
msgid "invalid commit-graph chain: line '%s' not a hash"
-msgstr "ogiltig incheckingsgrafkedja: rad ”%s” är inte ett hash-värde"
+msgstr "ogiltig incheckningsgrafkedja: rad ”%s” är inte ett hash-värde"
msgid "unable to find all commit-graph files"
-msgstr "kan inte hitta alla incheckingsgraffiler"
+msgstr "kan inte hitta alla incheckningsgraffiler"
msgid "invalid commit position. commit-graph is likely corrupt"
msgstr "ogiltig incheckningsposition. incheckningsgrafen är troligtvis trasig"
@@ -14627,8 +14729,8 @@ msgstr "Samlar refererade incheckningar"
#, c-format
msgid "Finding commits for commit graph in %<PRIuMAX> pack"
msgid_plural "Finding commits for commit graph in %<PRIuMAX> packs"
-msgstr[0] "Söker incheckningar för incheckingsgraf i %<PRIuMAX> paket"
-msgstr[1] "Söker incheckningar för incheckingsgraf i %<PRIuMAX> paket"
+msgstr[0] "Söker incheckningar för incheckningsgraf i %<PRIuMAX> paket"
+msgstr[1] "Söker incheckningar för incheckningsgraf i %<PRIuMAX> paket"
#, c-format
msgid "error adding pack %s"
@@ -14639,10 +14741,10 @@ msgid "error opening index for %s"
msgstr "fel vid öppning av indexet för %s"
msgid "Finding commits for commit graph among packed objects"
-msgstr "Söker incheckningar för incheckingsgraf i packade objekt"
+msgstr "Söker incheckningar för incheckningsgraf i packade objekt"
msgid "Finding extra edges in commit graph"
-msgstr "Söker ytterligare kanter i incheckingsgraf"
+msgstr "Söker ytterligare kanter i incheckningsgraf"
msgid "failed to write correct number of base graph ids"
msgstr "misslyckades skriva korrekt antal bas-graf-id:n"
@@ -14664,7 +14766,7 @@ msgid "unable to open commit-graph chain file"
msgstr "kan inte öppna incheckningsgrafkedjefilen"
msgid "failed to rename base commit-graph file"
-msgstr "misslyckades byta namn på bas-incheckingsgraffilen"
+msgstr "misslyckades byta namn på bas-incheckningsgraffilen"
msgid "failed to rename temporary commit-graph file"
msgstr "misslyckades byta namn på temporär incheckningsgraffil"
@@ -14777,7 +14879,7 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Stöd för <GIT_DIR>/info/grafts avråds från och\n"
"kommer tas bort i en framtida version av Git.\n"
@@ -14786,7 +14888,7 @@ msgstr ""
"för att omvandla grafts till ersättningsreferenser.\n"
"\n"
"Slå av detta meddelande genom att skriva\n"
-"”git config advice.graftFileDeprecated false”"
+"”git config set advice.graftFileDeprecated false”"
#, c-format
msgid "commit %s exists in commit-graph but not in the object database"
@@ -15233,7 +15335,7 @@ msgstr "referensen ”%s” pekar inte på en blob"
#, c-format
msgid "unable to resolve config blob '%s'"
-msgstr "kan inte slå upp konfigurerings-bloben ”%s”"
+msgstr "kan inte slå upp konfigurerings-blobben ”%s”"
msgid "unable to parse command-line config"
msgstr "kan inte tolka kommandoradskonfiguration"
@@ -15595,7 +15697,20 @@ msgstr "url saknar protokoll: %s"
#, c-format
msgid "credential url cannot be parsed: %s"
-msgstr "kan inte tolka url för inloggingsuppgifter: %s"
+msgstr "kan inte tolka url för inloggningsuppgifter: %s"
+
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "felaktig tidsgräns ”%s”, förväntade ett icke-negativt heltal"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr ""
+"felaktig värde för init-timeout ”%s”, förväntade ett icke-negativt heltal"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "felaktigt värde för max-connections ”%s”, förväntade ett heltal"
msgid "in the future"
msgstr "i framtiden"
@@ -15987,7 +16102,7 @@ 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"
+msgstr "visa sammanhang mellan diff-stycken upp till angivet antal rader"
msgid "<char>"
msgstr "<tecken>"
@@ -16296,6 +16411,20 @@ msgstr "felaktig git-namnrymdssökväg ”%s”"
msgid "too many args to run %s"
msgstr "för många flaggor för att köra %s"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Du försöker hämta %s som är i incheckningsgrafen men inte i "
+"objektdatabasen.\n"
+"Det händer antagligen på grund av att arkivet är trasigt.\n"
+"Om du försöker reparera det trasiga arkivet genom att hämta om det saknade "
+"objektet, använd ”git fetch --refetch” med det saknade objektet."
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: förväntade grund lista"
@@ -16493,7 +16622,7 @@ msgstr "Servern tillåter inte förfrågan om ej tillkännagivet objekt %s"
#, c-format
msgid "fsmonitor_ipc__send_query: invalid path '%s'"
-msgstr "fsmonitor_ipc__send_query: ogilitg sökväg ”%s”"
+msgstr "fsmonitor_ipc__send_query: ogiltig sökväg ”%s”"
#, c-format
msgid "fsmonitor_ipc__send_query: unspecified error on '%s'"
@@ -16767,7 +16896,7 @@ msgid "Interacting with Others"
msgstr "Interaktion med andra"
msgid "Low-level Commands / Manipulators"
-msgstr "Lågnivåkommandon / maniupulerare"
+msgstr "Lågnivåkommandon / manipulerare"
msgid "Low-level Commands / Interrogators"
msgstr "Lågnivåkommandon / frågare"
@@ -16807,7 +16936,7 @@ msgid "External commands"
msgstr "Externa kommandon"
msgid "Command aliases"
-msgstr "Kommadoalias"
+msgstr "Kommandoalias"
msgid "See 'git help <command>' to read about a specific subcommand"
msgstr "Se ”git help <kommando>” för att läsa om ett specifikt underkommando"
@@ -16880,10 +17009,10 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
"Kroken ”%s” ignorerades eftersom den inte är markerad som körbar.\n"
-"Du kan inaktivera varningen med ”git config advice.ignoredHook false”."
+"Du kan inaktivera varningen med ”git config set advice.ignoredHook false”."
msgid "not a git repository"
msgstr "inte ett git-arkiv"
@@ -16900,15 +17029,9 @@ msgstr "http.postBuffer har negativt värde; använder förvalet %d"
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Delegerad styrning stöds inte av cURL < 7.22.0"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "Fastnålning av öppen nyckel stöds inte av cURL < 7.39.0"
-
msgid "Unknown value for http.proactiveauth"
msgstr "Okänt värde för http.proactiveauth"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE stöds inte av cURL < 7.44.0"
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "SSL-bakändan ”%s” stöds inte. Dessa SSL-bakändor stöds:"
@@ -17092,6 +17215,10 @@ msgid "unable to format message: %s"
msgstr "kan inte formatera meddelandet: %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "felaktigt värde för marker-size ”%s”, förväntade ett heltal"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Misslyckades slå ihop undermodulen %s (ej utcheckad)"
@@ -17152,7 +17279,7 @@ 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 ""
-"KONFLIKT (implicit nämnändrad kat): Befintlig fil/kat vid %s är i vägen för "
+"KONFLIKT (implicit namnändrad kat): Befintlig fil/kat vid %s är i vägen för "
"implicit namnändrad(e) katalog(er) som lägger dit följande sökväg(ar): %s."
#, c-format
@@ -17314,7 +17441,7 @@ msgid ""
" - resolve any other conflicts in the superproject\n"
" - commit the resulting index in the superproject\n"
msgstr ""
-"Rekursiv sammanslaning med undermoduler stöder för närvarande endast enkla "
+"Rekursiv sammanslagning med undermoduler stöder för närvarande endast enkla "
"fall.\n"
"Du måste hantera sammanslagning av undermoduler i konflikt manuellt.\n"
"Detta kan göras genom att utföra följande steg:\n"
@@ -17996,6 +18123,14 @@ msgid "missing mapping of %s to %s"
msgstr "saknar koppling av %s till %s"
#, c-format
+msgid "unable to open %s"
+msgstr "kan inte öppna %s"
+
+#, c-format
+msgid "files '%s' and '%s' differ in contents"
+msgstr "filerna ”%s” och ”%s” har olika innehåll"
+
+#, c-format
msgid "unable to write file %s"
msgstr "kan inte skriva filen %s"
@@ -18039,7 +18174,7 @@ msgstr "kan inte utföra ”deflate” på nytt strömobjekt (%d)"
#, c-format
msgid "deflateEnd on stream object failed (%d)"
-msgstr "”deflatEend” på strömobjektet misslyckades (%d)"
+msgstr "”deflateEnd” på strömobjektet misslyckades (%d)"
#, c-format
msgid "unable to create directory %s"
@@ -18081,10 +18216,6 @@ msgid "%s is not a valid '%s' object"
msgstr "%s är inte ett giltigt ”%s”-objekt"
#, c-format
-msgid "unable to open %s"
-msgstr "kan inte öppna %s"
-
-#, c-format
msgid "hash mismatch for %s (expected %s)"
msgstr "hash stämmer inte för %s (förväntade %s)"
@@ -18185,7 +18316,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Git skapar normalt aldrig referenser som slutar med 40 hexadecimala\n"
"tecken, då detta ignoreras när du anger 40-hex enbart. Dessa\n"
@@ -18195,7 +18326,7 @@ msgstr ""
"\n"
"där ”$br” på något sätt blivit tomt och en 40-hex-referens skapats.\n"
"Undersök referenserna och ta kanske bort dem. Stäng av meddelandet\n"
-"genom att köra ”git config advice.objectNameWarning false”"
+"genom att köra ”git config set advice.objectNameWarning false”"
#, c-format
msgid "log for '%.*s' only goes back to %s"
@@ -18313,7 +18444,7 @@ msgid ""
"corrupted bitmap index file (too short to fit pseudo-merge table header)"
msgstr ""
"trasig bitkarteindexfil (för kort för att få plats för pseudo-"
-"sammanslagningsatbellhuvudet)"
+"sammanslagningstabellhuvudet)"
msgid "corrupted bitmap index file (too short to fit pseudo-merge table)"
msgstr ""
@@ -18354,13 +18485,6 @@ msgstr "flerpaketsbitkarta saknar nödvändigt omvänt index"
msgid "could not open pack %s"
msgstr "kunde inte öppna paketfilen %s"
-msgid "could not determine MIDX preferred pack"
-msgstr "kunde inte bestämma det föredragna MIDX-paketet"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "föredragen paketfil (%s) är ogiltig"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "trasig bitkarteuppslagstabell: trippelposition utanför indexet"
@@ -18414,7 +18538,7 @@ msgstr "bitkarteresultat stämmer inte överens"
#, c-format
msgid "pseudo-merge index out of range (%<PRIu32> >= %<PRIuMAX>)"
-msgstr "pseudosammanslaningsindex utenför intervallet (%<PRIu32> ≥ %<PRIuMAX>)"
+msgstr "pseudosammanslagningsindex utanför intervallet (%<PRIu32> ≥ %<PRIuMAX>)"
#, c-format
msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
@@ -18509,7 +18633,7 @@ msgstr "offset före slutet av packindex för %s (trasigt index?)"
#, c-format
msgid "offset beyond end of pack index for %s (truncated index?)"
-msgstr "offset borton slutet av packindex för %s (trunkerat index?)"
+msgstr "offset bortom slutet av packindex för %s (trunkerat index?)"
#, c-format
msgid "malformed expiration date '%s'"
@@ -18885,7 +19009,7 @@ msgid ""
"could not parse first line of `log` output: did not start with 'commit ': "
"'%s'"
msgstr ""
-"kunde inte tolka första raden i ”log”-updata: börjar inte med ”commit ”: ”%s”"
+"kunde inte tolka första raden i ”log”-utdata: börjar inte med ”commit ”: ”%s”"
#, c-format
msgid "could not parse git header '%.*s'"
@@ -19000,7 +19124,7 @@ msgstr "%s: öppning av indexfilen misslyckades"
#, c-format
msgid "%s: cannot stat the open index"
-msgstr "%s: kan inte ta startus på det öppna indexet"
+msgstr "%s: kan inte ta status på det öppna indexet"
#, c-format
msgid "%s: index file smaller than expected"
@@ -19269,7 +19393,7 @@ msgstr "kan inte helt tolka %s=%s"
#, c-format
msgid "value expected %s="
-msgstr "vädre förväntades %s="
+msgstr "värde förväntades %s="
#, c-format
msgid "positive value expected '%s' in %%(%s)"
@@ -19475,18 +19599,26 @@ msgstr "loggen för referensen %s slutade oväntat på %s"
msgid "log for %s is empty"
msgstr "loggen för %s är tom"
-msgid "refusing to force and skip creation of reflog"
-msgstr "vägrar att tvinga och hoppa över skapande av reflogg"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "vägrar uppdatera referens med trasigt namn ”%s”"
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "vägrar uppdatera referenslogg för pseudoreferensen ”%s”"
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "vägrar uppdatera pseudoreferensen ”%s”"
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "vägrar uppdatera referenslogg med trasigt namn ”%s”"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "vägrar uppdatera referens med trasigt namn ”%s”"
+
+msgid "refusing to force and skip creation of reflog"
+msgstr "vägrar att tvinga och hoppa över skapande av reflogg"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "update_ref misslyckades för referensen ”%s”: %s"
@@ -19536,6 +19668,10 @@ msgstr ""
"men är en vanlig referens"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "kan inte läsa ref-fil ”%s”"
+
+#, c-format
msgid "cannot open directory %s"
msgstr "kunde inte öppna katalogen %s"
@@ -19741,6 +19877,10 @@ msgid "more than one uploadpack given, using the first"
msgstr "mer än en uploadpack angavs, använder den första"
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "okänt värde ”%s” för followRemoteHEAD ignorerades"
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "okänt värde transfer.credentialsInUrl: ”%s”"
@@ -19792,7 +19932,7 @@ msgid ""
"\n"
"Neither worked, so we gave up. You must fully qualify the ref."
msgstr ""
-"Målet du angav är inte ett komplett referensamn (dvs.,\n"
+"Målet du angav är inte ett komplett referensnamn (dvs.,\n"
"startar med ”refs/”). Vi försökte gissa vad du menade genom att:\n"
"\n"
"- Se efter en referens som motsvarar ”%s” på fjärrsidan.\n"
@@ -20050,7 +20190,7 @@ msgstr "misslyckades hitta trädet för %s."
#, c-format
msgid "unsupported section for hidden refs: %s"
-msgstr "sktionen för dolda referenser stöds ej: %s"
+msgstr "sektionen för dolda referenser stöds ej: %s"
msgid "--exclude-hidden= passed more than once"
msgstr "--exclude-hidden= angavs mer än en gång"
@@ -20333,7 +20473,7 @@ msgid ""
"not sending a push certificate since the receiving end does not support --"
"signed push"
msgstr ""
-"sänder inte push-certifikat eftersom mottagarsidan inte stlder push med --"
+"sänder inte push-certifikat eftersom mottagarsidan inte stöder push med --"
"signed"
msgid "the receiving end does not support --atomic push"
@@ -20693,7 +20833,7 @@ msgstr "”%s” är inte ett giltigt referensnamn"
#, c-format
msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
-msgstr "update-ref kräver ett fullständigt referensnamn, t.ex refs/heads/%s"
+msgstr "update-ref kräver ett fullständigt referensnamn, t.ex. refs/heads/%s"
#, c-format
msgid "'%s' does not accept merge commits"
@@ -21665,6 +21805,9 @@ msgstr "incheckning %s är inte märkt nåbar"
msgid "too many commits marked reachable"
msgstr "för många incheckningar markerade nåbara"
+msgid "could not determine MIDX preferred pack"
+msgstr "kunde inte bestämma det föredragna MIDX-paketet"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<flaggor>]"
@@ -21698,7 +21841,7 @@ msgstr ""
"[<buntstorlek>]"
msgid "name or pathname of unix domain socket"
-msgstr "namn eller sövkäg till unixdomän-uttag"
+msgstr "namn eller sökväg till unixdomän-uttag"
msgid "named-pipe name"
msgstr "namn på namngivet rör"
@@ -21800,10 +21943,10 @@ msgstr "kunde inte läsa referensen %s"
#, c-format
msgid "unknown response to connect: %s"
-msgstr "okänt svar på ansluntning: %s"
+msgstr "okänt svar på anslutning: %s"
msgid "setting remote service path not supported by protocol"
-msgstr "protkollet stöder inte att sätta sökväg till fjärrtjänst"
+msgstr "protokollet stöder inte att sätta sökväg till fjärrtjänst"
msgid "invalid remote service path"
msgstr "felaktig sökväg till fjärrtjänst"
@@ -21816,7 +21959,7 @@ msgid "--negotiate-only requires protocol v2"
msgstr "--negotiate-only kräver protokoll v2"
msgid "'option' without a matching 'ok/error' directive"
-msgstr "”option” utan mostsvarande ”ok/error”-direktiv"
+msgstr "”option” utan motsvarande ”ok/error”-direktiv"
#, c-format
msgid "expected ok/error, helper said '%s'"
@@ -22319,6 +22462,9 @@ msgstr ".git-filen är trasig"
msgid ".git file incorrect"
msgstr ".git-filen är felaktig"
+msgid ".git file absolute/relative path mismatch"
+msgstr "absolut/relativ sökväg för .git-fil stämmer inte överens"
+
msgid "not a valid path"
msgstr "inte en giltig sökväg"
@@ -22334,6 +22480,9 @@ msgstr "kan inte hitta arkivet; ”.git”-filen är trasig"
msgid "gitdir unreadable"
msgstr "gitdir är oläsbar"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "absolut/relativ sökväg för git-katalog stämmer inte överens"
+
msgid "gitdir incorrect"
msgstr "gitdir är felaktig"
@@ -22368,6 +22517,13 @@ msgstr "kan inte slå av %s i ”%s”"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "misslyckades ändra inställningen extensions.worktreeConfig"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"kunde inte uppgradera arkivformat till att stöda relativa arbetskataloger"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "misslyckades ändra inställningen extensions.relativeWorktrees"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "kunde inte lagra miljövariabeln ”%s”"
@@ -22866,7 +23022,7 @@ msgstr "Kan inte byta katalog till $cdup, toppnivån på arbetskatalogen"
#, sh-format
msgid "fatal: $program_name cannot be used without a working tree."
-msgstr "ödesdigetrt: $program_name kan inte användas utan arbetskatalog."
+msgstr "ödesdigert: $program_name kan inte användas utan arbetskatalog."
msgid "Cannot rewrite branches: You have unstaged changes."
msgstr "Kan inte skriva om grenar: Du har oköade ändringar."
@@ -22915,7 +23071,7 @@ msgid "--dump-aliases incompatible with other options\n"
msgstr "--dump-aliases är inkompatibelt med andra flaggor\n"
msgid "--dump-aliases and --translate-aliases are mutually exclusive\n"
-msgstr "--dump-aliases och --translate-aliases är ömsesidigt utelsutande\n"
+msgstr "--dump-aliases och --translate-aliases är ömsesidigt uteslutande\n"
msgid ""
"fatal: found configuration options for 'sendmail'\n"
@@ -22956,7 +23112,7 @@ msgstr "varning: ”:include:” stöds inte: %s\n"
#, perl-format
msgid "warning: `/file` or `|pipe` redirection not supported: %s\n"
-msgstr "varning: omdirigering til ”/fil” eller ”|rör” stöds inte: %s\n"
+msgstr "varning: omdirigering till ”/fil” eller ”|rör” stöds inte: %s\n"
#, perl-format
msgid "warning: sendmail line is not recognized: %s\n"
@@ -23184,7 +23340,7 @@ msgid "cannot send message as 7bit"
msgstr "kan inte sända brev som sjubitars"
msgid "invalid transfer encoding"
-msgstr "ogiltig överföringskondning"
+msgstr "ogiltig överföringskodning"
#, perl-format
msgid ""
@@ -23217,10 +23373,3 @@ msgstr ""
#, perl-format
msgid "Do you really want to send %s? [y|N]: "
msgstr "Vill du verkligen sända %s? [y=ja, n=nej]: "
-
-#~ msgid "revision walk setup failed\n"
-#~ msgstr "misslyckades starta revisionstraversering\n"
-
-#, c-format
-#~ msgid "unable to parse contact: %s"
-#~ msgstr "kan inte tolka kontakt: %s"
diff --git a/po/tr.po b/po/tr.po
index 7aede5cd5f..1bc43453aa 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -2,7 +2,7 @@
# Git Türkçe çevirileri
# Copyright (C) 2020-2024 Emir SARI <emir_sari@icloud.com>
# This file is distributed under the same license as the Git package.
-# Emir SARI <emir_sari@icloud.com>, 2020-2024
+# Emir SARI <emir_sari@icloud.com>, 2020-2025
#
# ######################################################### #
# Git Türkçe kavramlar dizini / Git Turkish Glossary #
@@ -96,8 +96,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: 2024-10-03 06:52+0300\n"
-"PO-Revision-Date: 2024-10-03 07:00+0300\n"
+"POT-Creation-Date: 2024-12-23 18:57+0000\n"
+"PO-Revision-Date: 2025-01-01 15: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"
@@ -714,10 +714,10 @@ msgstr "Yalnızca ikili dosyalar değiştirildi."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Bu iletiyi \"git config advice.%s false\" ile devre dışı bırakın"
+"Bu iletiyi \"git config set advice.%s false\" ile devre dışı bırakın"
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -1441,8 +1441,9 @@ msgstr "geçerli bir nesne adı değil: %s"
msgid "not a tree object: %s"
msgstr "bir ağaç nesnesi değil: %s"
-msgid "unable to checkout working tree"
-msgstr "çalışma ağacı çıkış yapılamıyor"
+#, c-format
+msgid "failed to unpack tree object %s"
+msgstr "%s ağaç nesnesi açılamadı"
#, c-format
msgid "File not found: %s"
@@ -3072,8 +3073,8 @@ msgid "HEAD not found below refs/heads!"
msgstr "HEAD, refs/heads altında bulunamadı!"
msgid ""
-"branch with --recurse-submodules can only be used if submodule."
-"propagateBranches is enabled"
+"branch with --recurse-submodules can only be used if "
+"submodule.propagateBranches is enabled"
msgstr ""
"--recurse-submodules ile dallanma, yalnızca submodule.propagateBranches "
"etkinleştirilmişse kullanılabilir"
@@ -3921,9 +3922,8 @@ msgstr "yeni henüz doğmamış dal"
msgid "update ignored files (default)"
msgstr "yok sayılan dosyaları güncelle (öntanımlı)"
-msgid "do not check if another worktree is holding the given ref"
-msgstr ""
-"verilen başvuruyu başka bir çalışma ağacının tutup tutmadığını denetleme"
+msgid "do not check if another worktree is using this branch"
+msgstr "bu dalı başka bir çalışma ağacının kullanıp kullanmadığını denetleme"
msgid "checkout our version for unmerged files"
msgstr "birleştirilmeyen dosyalar için bizdeki sürümü çıkış yap"
@@ -4224,11 +4224,11 @@ msgstr "verilen derinlikte sığ bir depo oluştur"
msgid "create a shallow clone since a specific time"
msgstr "verilen zamandan sonrasını içeren bir sığ depo oluştur"
-msgid "revision"
-msgstr "revizyon"
+msgid "ref"
+msgstr "başvuru"
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "revizyonu hariç tutarak sığ klonun geçmişini derinleştir"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "başvuru hariç tutarak sığ klonun geçmişini derinleştir"
msgid "clone only one branch, HEAD or --branch"
msgstr "yalnızca bir dal klonla, HEAD veya --branch"
@@ -4355,6 +4355,9 @@ msgstr "sparse-checkout ilklendirilemedi"
msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr "uzak konum HEAD'i, var olmayan başvuruya başvuruyor; çıkış yapılamıyor"
+msgid "unable to checkout working tree"
+msgstr "çalışma ağacı çıkış yapılamıyor"
+
msgid "unable to write parameters to config file"
msgstr "parametreler yapılandırma dosyasına yazılamıyor"
@@ -5163,10 +5166,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
"git config unset [<dosya-seçeneği>] [--all] [--value=<değer>] [--fixed-"
-"value] <ad> <değer>"
+"value] <ad>"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr "git config rename-section [<dosya-seçeneği>] <eski-ad> <yeni-ad>"
@@ -5601,12 +5604,8 @@ msgid "traversed %lu commits\n"
msgstr "%lu işleme katedildi\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"%i etiketten fazla etiket bulundu; en son %i listelendi\n"
-"şu konumda arama bırakıldı: %s\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "%i etiket bulundu; arama şurada bitirildi: %s\n"
#, c-format
msgid "describe %s\n"
@@ -6040,6 +6039,21 @@ msgstr "%s geçerli bir nesne değil"
msgid "the object %s does not exist"
msgstr "%s diye bir nesne yok"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Değişikliği izlemek için 'git remote set-head %s %s' yapın veya\n"
+"'remote.%s.followRemoteHEAD' yapılandırma seçeneğini başka bir\n"
+"değere ayarlayın (bu iletiyi görmek istemiyorsanız). Özellikle\n"
+"'git config set remote.%s.followRemoteHEAD %s' komutunu çalıştırmak\n"
+"uyarıyı HEAD'e veya başka bir şeye uzaktan değişiklik olana dek\n"
+"devre dışı bırakır."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "birden çok dal algılandı, --set-upstream ile uyumsuz"
@@ -6178,6 +6192,9 @@ msgstr "ilgili başvuru"
msgid "specify fetch refmap"
msgstr "getirme ile ilgili başvuruları belirt"
+msgid "revision"
+msgstr "revizyon"
+
msgid "report that we have only objects reachable from this object"
msgstr "yalnızca bu nesneden ulaşılabilir nesnelerimiz olduğunu bildir"
@@ -6232,8 +6249,8 @@ msgid "protocol does not support --negotiate-only, exiting"
msgstr "protokol, --negotiate-only desteklemediğinden çıkılıyor"
msgid ""
-"--filter can only be used with the remote configured in extensions."
-"partialclone"
+"--filter can only be used with the remote configured in "
+"extensions.partialclone"
msgstr ""
"--filter, yalnızca extensions.partialclone içinde yapılandırılmış uzak konum "
"ile kullanılabilir"
@@ -6898,8 +6915,27 @@ msgstr "ne systemd zamanlayıcıları ne de crontab kullanılabiliyor"
msgid "%s scheduler is not available"
msgstr "%s planlayıcısı kullanılamıyor"
-msgid "another process is scheduling background maintenance"
-msgstr "başka bir işlem arka plan bakımı zamanını planlıyor"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"'%s.lock' oluşturulamıyor: %s.\n"
+"\n"
+"Bu depoda başka bir planlı git-maintenance(1) süreci çalışıyor gibi\n"
+"görünüyor. Lütfen başka bir bakım sürecinin çalışmıyor olduğundan emin\n"
+"olun ve yeniden deneyin. Eğer hâlâ başarısız oluyorsa bir git-"
+"maintenance(1)\n"
+"süreci bu depo içinde daha önceden çakılmış olabilir: Sürdürmek için "
+"dosyayı\n"
+"elle kaldırın."
+
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "planlı arka plan bakımı için kilit alınamıyor"
msgid "git maintenance start [--scheduler=<scheduler>]"
msgstr "git maintenance start [--scheduler=<görev-planlayıcı>]"
@@ -7472,8 +7508,22 @@ msgid_plural "chain length = %d: %lu objects"
msgstr[0] "zincir uzunluğu = %d: %lu nesne"
msgstr[1] "zincir uzunluğu = %d: %lu nesne"
+msgid "could not start pack-objects to repack local links"
+msgstr "yerel bağlantıları yeniden paketleme için pack-objects başlatılamadı"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "yerel nesne pack-objects'e beslenemedi"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: Onaltılı tam nesne kimliği satırları yalnızca pack-objects'ten "
+"bekleniyor."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr "yerel bağlantıları yeniden paketleme için pack-objects bitirilemedi"
+
msgid "Cannot come back to cwd"
-msgstr "Şu anki çalışma dizinine geri gelinemiyor"
+msgstr "Geçerli çalışma dizinine geri gelinemiyor"
#, c-format
msgid "bad %s"
@@ -7483,6 +7533,9 @@ msgstr "hatalı %s"
msgid "unknown hash algorithm '%s'"
msgstr "bilinmeyen sağlama algoritması '%s'"
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor bir paket adıyla kullanılamaz"
+
msgid "--stdin requires a git repository"
msgstr "--stdin bir git dizini gerektirir"
@@ -8826,11 +8879,11 @@ msgstr "git notes [--ref <not-bşvr>] [list [<nesne>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
-"git notes [--ref <not-bşv>] add [-f] [--allow-empty] [--[no-]separator|--"
-"separator=<paragraf-sonu>] [--[no-]stripspace] [-m <ilet> | -F <dosya> | (-c "
-"| -C) <nesne>] [<nesne>]"
+"git notes [--ref <notlar-baş>] add [-f] [--allow-empty] [--[no-]separator|--"
+"separator=<paragraf-kes>] [--[no-]stripspace] [-m <ileti> | -F <dosya> | (-c "
+"| -C) <nesne>] [<nesne>] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr "git notes [--ref <not-bşvr>] copy [-f] <nesneden> <nesneye>"
@@ -8838,11 +8891,11 @@ msgstr "git notes [--ref <not-bşvr>] copy [-f] <nesneden> <nesneye>"
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
-"git notes [--ref <not-bşv>] append [--allow-empty] [--[no-]separator|--"
-"separator=<paragraf-sonu>] [--[no-]stripspace] [-m <ileti> | -F <dosya> | (-"
-"c | -C) <nesne>] [<nesne>]"
+"git notes [--ref <notlar-baş>] append [--allow-empty] [--[no-]separator|--"
+"separator=<paragraf-kes>] [--[no-]stripspace] [-m <ileti> | -F <dosya> | (-c "
+"| -C) <nesne>] [<nesne>] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <not-bşvr>] edit [--allow-empty] [<nesne>]"
@@ -8960,6 +9013,9 @@ msgstr "not içeriği bir dosyada"
msgid "reuse and edit specified note object"
msgstr "belirtilen not nesnesini düzenle ve yeniden kullan"
+msgid "edit note message in editor"
+msgstr "not iletisini düzenleyicide aç"
+
msgid "reuse specified note object"
msgstr "belirtilen not nesnesini yeniden kullan"
@@ -9456,6 +9512,9 @@ msgstr "eksik nesneler için işlem"
msgid "do not pack objects in promisor packfiles"
msgstr "nesneleri vaatçi paket dosyalarıyla paketleme"
+msgid "implies --missing=allow-any"
+msgstr "--missing=allow-any ima eder"
+
msgid "respect islands during delta compression"
msgstr "delta sıkıştırması sırasında adalara uy"
@@ -11057,6 +11116,31 @@ msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " 'git push'%s için yapılandırılan yerel başvuru:"
msgstr[1] " 'git push'%s için yapılandırılan yerel başvurular:"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "'%s/HEAD' değiştirilmedi ve '%s' konumuna işaret ediyor\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD', '%s' konumundan '%s' konumuna değiştirildi\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "'%s/HEAD' şimdi oluşturuldu ve '%s' konumuna işaret ediyor\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr ""
+"'%s/HEAD', '%s' konumunda ayrıldı ve artık '%s' konumuna işaret ediyor\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"'%s/HEAD', uzak dal olmayan '%s' konumuna işaret ediyordu; ancak şimdi '%s' "
+"konumuna işaret ediyor\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "refs/remotes/<ad>/HEAD'i uzak konuma göre ayarla"
@@ -11078,7 +11162,7 @@ msgid "Not a valid ref: %s"
msgstr "Geçerli bir başvuru değil: %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "%s ayarlanamadı"
#, c-format
@@ -13779,6 +13863,9 @@ msgstr "izleme kipini ayarla (bkz: git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "yeni dalın adını bir uzak izleme dalıyla eşleştirmeyi dene"
+msgid "use relative paths for worktrees"
+msgstr "çalışma ağaçları için göreceli yollar kullan"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "'%s', '%s' ve '%s' seçenekleri birlikte kullanılamaz"
@@ -14050,6 +14137,25 @@ msgstr "'%s' oluşturulamıyor"
msgid "index-pack died"
msgstr "index-pack sonlandı"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "'%s' dizini indekste var; ancak aralıklı değil"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "hasarlı cache-tree'de indekste olmayan girdiler var"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s, 0x%x bayraklı olarak cache-tree'de olmamalı"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "hatalı alt ağaç '%.*s'"
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr "%.*s yolu için olan cache-tree eşleşmiyor. %s bekleniyordu, %s alındı"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "iri parça numarası sonlandırması beklenenden önce ortaya çıkıyor"
@@ -14829,8 +14935,8 @@ msgid ""
"attempting to write a commit-graph, but 'commitGraph.changedPathsVersion' "
"(%d) is not supported"
msgstr ""
-"bir commit-graph yazılmaya çalışılıyor; ancak 'commitGraph."
-"changedPathsVersion' (%d) desteklenmiyor"
+"bir commit-graph yazılmaya çalışılıyor; ancak "
+"'commitGraph.changedPathsVersion' (%d) desteklenmiyor"
msgid "too many commits to write graph"
msgstr "grafik yazımı için pek fazla işleme"
@@ -14909,7 +15015,7 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"<GIT_DIR>/info/grafts desteği artık kullanılmamalı\n"
"ve ileriki bir Git sürümünde kaldırılacak.\n"
@@ -14917,7 +15023,7 @@ msgstr ""
"Aşıları değiştirme başvurularına dönüştürmek için\n"
"lütfen \"git replace --convert-graft-file\" kullanın.\n"
"\n"
-"\"git config advice.graftFileDeprecated false\"\n"
+"\"git config set advice.graftFileDeprecated false\"\n"
"kullanarak bu iletiyi kapatabilirsiniz"
#, c-format
@@ -15176,8 +15282,8 @@ msgid ""
"remote URLs cannot be configured in file directly or indirectly included by "
"includeIf.hasconfig:remote.*.url"
msgstr ""
-"uzak URL'ler dosya içinde doğrudan veya başka türlü includeIf.hasconfig:"
-"remote.*.url kullanarak yapılandırılamaz"
+"uzak URL'ler dosya içinde doğrudan veya başka türlü "
+"includeIf.hasconfig:remote.*.url kullanarak yapılandırılamaz"
#, c-format
msgid "invalid config format: %s"
@@ -15733,6 +15839,19 @@ msgstr "url'nin şeması yok: %s"
msgid "credential url cannot be parsed: %s"
msgstr "yetki url'si ayrıştırılamıyor: %s"
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "geçersiz zaman aşımı '%s', negatif olmayan bir tamsayı bekleniyor"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr ""
+"geçersiz ilklendirme zaman aşımı '%s', negatif olmayan bir tamsayı bekleniyor"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "geçersiz en çok bağlantı '%s', bir tamsayı bekleniyor"
+
msgid "in the future"
msgstr "gelecekte"
@@ -16439,6 +16558,20 @@ msgstr "hatalı git ad alanı yolu \"%s\""
msgid "too many args to run %s"
msgstr "%s çalıştırmak için pek fazla argüman"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"İşleme grafiğinde bulunan; ancak nesne veritabanında bulunmayan %s ögesini "
+"getirmeyi deniyorsunuz.\n"
+"Bu, büyük olasılıkla depo hasarından dolayı oluyor.\n"
+"Bu depo hasarını eksik nesneyi yeniden getirerek onarmayı düşünüyorsanız "
+"eksik nesneyle birlikte 'git fetch --refetch' kullanmayı deneyin."
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: sığ bir liste bekleniyordu"
@@ -17024,10 +17157,10 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
"'%s' kancası yok sayıldı; çünkü bir yürütülebilir olarak ayarlanmamış.\n"
-"Bu uyarıyı 'git config advice.ignoredHook false' ile kapatabilirsiniz."
+"Bu uyarıyı 'git config set advice.ignoredHook false' ile kapatabilirsiniz."
msgid "not a git repository"
msgstr "bir git deposu değil"
@@ -17043,15 +17176,9 @@ msgstr "http.postBuffer için negatif değer; %d olarak varsayılıyor"
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Delegasyon denetimi cURL < 7.22.0 tarafından desteklenmiyor"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "Ortak anahtar iğnelemesi cURL < 7.39.0 tarafından desteklenmiyor"
-
msgid "Unknown value for http.proactiveauth"
msgstr "http.proactiveauth için bilinmeyen değer"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE cURL < 7.44.0 tarafından desteklenmiyor"
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "Desteklenmeyen SSL arka ucu '%s'. Desteklenen SSL arka uçları:"
@@ -17238,6 +17365,10 @@ msgid "unable to format message: %s"
msgstr "ileti biçimlendirilemiyor: %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "geçersiz imleyici boyutu '%s', bir tamsayı bekleniyor"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "%s altmodülü birleştirilemedi (çıkış yapılmadı)"
@@ -18339,7 +18470,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Git normalde hiçbir zaman 40 onaltılı karakterlerle biten bir başvuru\n"
"oluşturmaz; çünkü 40 onaltılı bir başvuru, onu belirlediğiniz zaman yok\n"
@@ -18350,7 +18481,7 @@ msgstr ""
"komutunda \"$br\" bir şekilde boş kalmış ve 40 onaltılı bir başvuru\n"
"oluşturulmuş. Lütfen bu başvuruları inceleyin ve gerekirse silin. Bu "
"iletiyi\n"
-"kapatmak için \"git config advice.objectNameWarning\" yapın"
+"kapatmak için \"git config set advice.objectNameWarning\" yapın"
#, c-format
msgid "log for '%.*s' only goes back to %s"
@@ -18511,13 +18642,6 @@ msgstr "çoklu paket biteşlemi gereken ters indeksi içermiyor"
msgid "could not open pack %s"
msgstr "%s paketi açılamadı"
-msgid "could not determine MIDX preferred pack"
-msgstr "MIDX yeğlenen paketi algılanamadı"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "yeğlenen paket (%s) geçersiz"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "hasarlı biteşlem arama tablosu: üçlü konum indeks dışında"
@@ -19343,8 +19467,8 @@ msgid ""
msgstr ""
"Bu iletiden kaçınmak için, bir işlemeyi kaldırırken açıkça \"drop\" "
"kullanın.\n"
-"Uyarıların düzeyini değiştirmek için 'git config rebase."
-"missingCommitsCheck'\n"
+"Uyarıların düzeyini değiştirmek için 'git config "
+"rebase.missingCommitsCheck'\n"
"kullanın. Kullanılabilir davranışlar: ignore, warn, error.\n"
"\n"
@@ -19626,18 +19750,27 @@ msgstr ""
msgid "log for %s is empty"
msgstr "%s için olan günlük boş"
-msgid "refusing to force and skip creation of reflog"
-msgstr "başvuru günlüğünün oluşturulma/atlanma zorlanması reddediliyor"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "hatalı ada iye '%s' başvurusunu güncelleme reddediliyor"
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr ""
+"'%s' yalancı başvurusu için olan başvuru günlüğünü güncelleme reddediliyor"
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "'%s' yalancı başvurusunun güncellenmesi reddediliyor"
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "hatalı adlı '%s' başvuru günlüğünü güncelleme reddediliyor"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "hatalı ada iye '%s' başvurusunu güncelleme reddediliyor"
+
+msgid "refusing to force and skip creation of reflog"
+msgstr "başvuru günlüğünün oluşturulma/atlanma zorlanması reddediliyor"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "'%s' başvurusu için update_ref başarısız oldu: %s"
@@ -19687,6 +19820,10 @@ msgstr ""
"bekleniyordu; ancak bu normal bir başvuru"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "başvuru dosyası '%s' yazılamıyor"
+
+#, c-format
msgid "cannot open directory %s"
msgstr "%s dizini açılamıyor"
@@ -19894,6 +20031,10 @@ msgid "more than one uploadpack given, using the first"
msgstr "birden fazla uploadpack verildi, birincisi kullanılıyor"
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "tanımlanamayan followRemoteHEAD değeri '%s' yok sayıldı"
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "tanımlanamayan değer transfer.credentialsInUrl: '%s'"
@@ -21814,6 +21955,9 @@ msgstr "%s işlemesi ulaşılabilir olarak imlenmedi"
msgid "too many commits marked reachable"
msgstr "pek fazla işleme ulaşılabilir olarak imlenmiş"
+msgid "could not determine MIDX preferred pack"
+msgstr "MIDX yeğlenen paketi algılanamadı"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<seçenekler>]"
@@ -22462,6 +22606,9 @@ msgstr ".git dosyası bozuk"
msgid ".git file incorrect"
msgstr ".git dosyası doğru değil"
+msgid ".git file absolute/relative path mismatch"
+msgstr ".git dosyası mutlak/göreceli yolu uyumsuzluğu"
+
msgid "not a valid path"
msgstr "geçerli bir yol değil"
@@ -22477,6 +22624,9 @@ msgstr "depo konumu bulunamıyor: .git dosyası bozuk"
msgid "gitdir unreadable"
msgstr "okunamayan gitdir"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "gitdir mutlak/göreceli yolu uyumsuzluğu"
+
msgid "gitdir incorrect"
msgstr "doğru olmayan gitdir"
@@ -22511,6 +22661,13 @@ msgstr "%s, '%s' içinde ayarı kaldırılamıyor"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "extensions.worktreeConfig yapılandırması ayarlanamadı"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"depo biçimi göreceli çalışma ağaçlarını desteklemesi için yükseltilemiyor"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "extensions.relativeWorktrees yapılandırması ayarlanamadı"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "setenv '%s' yapılamadı"
diff --git a/po/uk.po b/po/uk.po
index 297f7b0687..5f68f36c7d 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,9 +8,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Git v2.46\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-04-11 09:55-0700\n"
-"PO-Revision-Date: 2024-07-24 08:45-0700\n"
-"Last-Translator: Arkadii Yakovets <ark@cho.red>\n"
+"POT-Creation-Date: 2025-01-04 19:26-0800\n"
+"PO-Revision-Date: 2025-01-03 14:17-0800\n"
+"Last-Translator: Kateryna Golovanova <kate@kgthreads.com>\n"
"Language-Team: Ukrainian <https://github.com/arkid15r/git-uk-l10n/>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
@@ -18,7 +18,7 @@ msgstr ""
"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.4.2\n"
+"X-Generator: Poedit 3.5\n"
#, c-format
msgid "Huh (%s)?"
@@ -41,7 +41,7 @@ msgstr "Оновити"
#, c-format
msgid "could not stage '%s'"
-msgstr "не вдалося додати до індексу %s"
+msgstr "не вдалося додати до індексу \"%s\""
msgid "could not write index"
msgstr "не вдалося записати індекс"
@@ -549,7 +549,7 @@ msgid ""
"/ - 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"
-"p - print the current hunk\n"
+"p - print the current hunk, 'P' to use the pager\n"
"? - print help\n"
msgstr ""
"j - залишити цей шматок невизначеним, перейти до наступного невизначеного "
@@ -562,7 +562,7 @@ msgstr ""
"/ - шукати шматок, що відповідає заданому регвиру\n"
"s - розбити поточний шматок на менші шматки\n"
"e - редагувати поточний шматок вручну\n"
-"p - показати поточний шматок\n"
+"p - показати поточний шматок, \"P\" для гортання сторінок\n"
"? - показати довідку\n"
#, c-format
@@ -634,10 +634,11 @@ msgstr "Змінено лише бінарні файли."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Вимкнути це повідомлення можна за допомогою \"git config advice.%s false\""
+"Вимкнути це повідомлення можна за допомогою \"git config set advice.%s "
+"false\""
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -761,8 +762,8 @@ msgstr ""
"\n"
" git switch -\n"
"\n"
-"Щоб вимкнути цю пораду, встановіть конфігураційний параметр advice."
-"detachedHead у false\n"
+"Щоб вимкнути цю пораду, встановіть конфігураційний параметр "
+"advice.detachedHead у false\n"
#, c-format
msgid ""
@@ -1255,6 +1256,15 @@ msgstr ""
"спробувати тристороннє злиття, повернутися до звичайного латання, якщо це не "
"вдасться"
+msgid "for conflicts, use our version"
+msgstr "у разі конфліктів використовувати нашу версію"
+
+msgid "for conflicts, use their version"
+msgstr "у разі конфліктів використовувати їхню версію"
+
+msgid "for conflicts, use a union version"
+msgstr "у разі конфліктів використовувати обʼєднану версію"
+
msgid "build a temporary index based on embedded index information"
msgstr "створити тимчасовий індекс на основі вбудованої індексної інформації"
@@ -1300,6 +1310,9 @@ msgstr "додати <корінь> до всіх назв файлів"
msgid "don't return error for empty patches"
msgstr "не повертати помилку для порожніх латок"
+msgid "--ours, --theirs, and --union require --3way"
+msgstr "--ours, --theirs, та --union вимагають --3way"
+
#, c-format
msgid "cannot stream blob %s"
msgstr "неможливо транслювати blob %s"
@@ -1372,6 +1385,10 @@ msgid "not a tree object: %s"
msgstr "не є об’єктом дерева: %s"
#, c-format
+msgid "failed to unpack tree object %s"
+msgstr "не вдалося розпакувати обʼєкт дерева %s"
+
+#, c-format
msgid "File not found: %s"
msgstr "Файл не знайдено: %s"
@@ -2174,7 +2191,7 @@ msgstr ""
#, c-format
msgid "Could not parse object '%s'."
-msgstr "Не вдалося розібрати об'єкт '%s'."
+msgstr "Не вдалося розібрати обʼєкт \"%s\"."
msgid "failed to clean index"
msgstr "не вдалося очистити індекс"
@@ -2484,9 +2501,6 @@ 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\" для додавання"
@@ -3026,8 +3040,8 @@ msgid "HEAD not found below refs/heads!"
msgstr "HEAD не знайдено під refs/heads!"
msgid ""
-"branch with --recurse-submodules can only be used if submodule."
-"propagateBranches is enabled"
+"branch with --recurse-submodules can only be used if "
+"submodule.propagateBranches is enabled"
msgstr ""
"гілку з --recurse-submodules можна використовувати лише якщо увімкнено "
"submodule.propagateBranches"
@@ -3478,9 +3492,14 @@ msgstr "git check-mailmap [<опції>] <контакт>..."
msgid "also read contacts from stdin"
msgstr "також читати контакти з stdin"
-#, c-format
-msgid "unable to parse contact: %s"
-msgstr "не вдалося розібрати контакт: %s"
+msgid "read additional mailmap entries from file"
+msgstr "зчитувати додаткові записи mailmap з файлу"
+
+msgid "blob"
+msgstr "blob"
+
+msgid "read additional mailmap entries from blob"
+msgstr "зчитувати додаткові записи mailmap з blob"
msgid "no contacts specified"
msgstr "контакти не вказані"
@@ -3648,7 +3667,7 @@ msgstr "Вже на \"%s\"\n"
#, c-format
msgid "Switched to and reset branch '%s'\n"
-msgstr "Переключено на та скинуто гілку '%s'\n"
+msgstr "Переключено на та скинуто гілку \"%s\"\n"
#, c-format
msgid "Switched to a new branch '%s'\n"
@@ -3842,19 +3861,23 @@ msgstr "шляхи не можуть використовуватись при �
#, c-format
msgid "'%s' cannot be used with switching branches"
-msgstr "'%s' не може використовуватись при переключенні гілок"
+msgstr "\"%s\" не може використовуватись при переключенні гілок"
+
+#, c-format
+msgid "'%s' needs the paths to check out"
+msgstr "\"%s\" потрібні шляхи для переходу"
#, c-format
msgid "'%s' cannot be used with '%s'"
-msgstr "'%s' не може використовуватись з '%s'"
+msgstr "\"%s\" не може використовуватись з \"%s\""
#, c-format
msgid "'%s' cannot take <start-point>"
-msgstr "'%s' не може прийняти <стартова-точка>"
+msgstr "\"%s\" не може прийняти <стартова-точка>"
#, c-format
msgid "Cannot switch branch to a non-commit '%s'"
-msgstr "Неможливо переключити гілку на не коміт '%s'"
+msgstr "Неможливо переключити гілку на не коміт \"%s\""
msgid "missing branch or commit argument"
msgstr "відсутня гілка або коміт"
@@ -3887,8 +3910,8 @@ msgstr "нова ненароджена гілка"
msgid "update ignored files (default)"
msgstr "оновити ігноровані файли (за замовчуванням)"
-msgid "do not check if another worktree is holding the given ref"
-msgstr "не перевіряти, чи інше робоче дерево містить дане посилання"
+msgid "do not check if another worktree is using this branch"
+msgstr "не перевіряти, чи використовує цю гілку інше робоче дерево"
msgid "checkout our version for unmerged files"
msgstr "використовувати нашу версію для не злитих файлів"
@@ -3919,11 +3942,11 @@ msgstr "неприпустиме зазначення шляху"
#, c-format
msgid "'%s' is not a commit and a branch '%s' cannot be created from it"
-msgstr "'%s' не є комітом, і з нього не можна створити гілку '%s'"
+msgstr "\"%s\" не є комітом, і з нього не можна створити гілку \"%s\""
#, c-format
msgid "git checkout: --detach does not take a path argument '%s'"
-msgstr "git checkout: --detach не приймає аргумент шляху '%s'"
+msgstr "git checkout: --detach не приймає аргумент шляху \"%s\""
msgid ""
"git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
@@ -4191,11 +4214,11 @@ msgstr "створити неглибокий клон вказаної глиб
msgid "create a shallow clone since a specific time"
msgstr "створити неглибокий клон з певного часу"
-msgid "revision"
-msgstr "ревізія"
+msgid "ref"
+msgstr "посилання"
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "поглибити історію неглибокого клону, за винятком ревізії"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "поглибити історію неглибокого клону, за винятком посилання"
msgid "clone only one branch, HEAD or --branch"
msgstr "клонувати лише одну гілку, HEAD або --branch"
@@ -4428,7 +4451,7 @@ msgstr "не вдалося ініціалізувати сховище, URI п�
#, c-format
msgid "failed to fetch objects from bundle URI '%s'"
-msgstr "не вдалося отримати обʼєкти з пакунка URI '%s'"
+msgstr "не вдалося отримати обʼєкти з пакунка URI \"%s\""
msgid "failed to fetch advertised bundles"
msgstr "не вдалося отримати обіцяні пакунки"
@@ -4618,7 +4641,7 @@ msgstr "git commit-tree: не вдалося прочитати"
msgid ""
"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
" [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
-"reword):]<commit>)]\n"
+"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"
@@ -4628,14 +4651,14 @@ msgid ""
msgstr ""
"git commit [-a | --interactive | --patch] [-s] [-v] [-u<режим>] [--amend]\n"
" [--dry-run] [(-c | -C | --squash) <коміт> | --fixup [(amend|"
-"reword):]<коміт>)]\n"
+"reword):]<коміт>]\n"
" [-F <файл> | -m <допис>] [--reset-author] [--allow-empty]\n"
" [--allow-empty-message] [--no-verify] [-e] [--author=<автор>]\n"
" [--date=<дата>] [--cleanup=<режим>] [--[no-]status]\n"
" [-i | -o] [--pathspec-from-file=<файл> [--pathspec-file-nul]]\n"
-" [(--trailer <токен>[(=|:)<значення>])...] [-S[<ідентифікатор "
+" [(--trailer <токен>[(=|:)<значення>])...] [-S[<ідентифікатор-"
"ключа>]]\n"
-" [--] [<визначник шляху>...]"
+" [--] [<визначник-шляху>...]"
msgid "git status [<options>] [--] [<pathspec>...]"
msgstr "git status [<опції>] [--] [<визначник шляху>...]"
@@ -5121,12 +5144,11 @@ msgstr "git config list [<опція-файлу>] [<опція-відображ�
msgid ""
"git config get [<file-option>] [<display-option>] [--includes] [--all] [--"
-"regexp=<regexp>] [--value=<value>] [--fixed-value] [--default=<default>] "
-"<name>"
+"regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>"
msgstr ""
"git config get [<опція-файлу>] [<опція-відображення>] [--includes] [--all] "
-"[--regexp=<регвир>] [--value=<значення>] [--fixed-value] [--"
-"default=<значення -за-умовчанням>] <назва>"
+"[--regexp] [--value=<значення>] [--fixed-value] [--default=<за "
+"замовчуванням>] <назва>"
msgid ""
"git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--"
@@ -5137,10 +5159,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
"git config unset [<опція-файлу>] [--all] [--value=<значення>] [--fixed-"
-"value] <назва> <значення>"
+"value] <назва>"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr "git config rename-section [<опція-файлу>] <стара-назва> <нова-назва>"
@@ -5155,6 +5177,15 @@ msgid "git config [<file-option>] --get-colorbool <name> [<stdout-is-tty>]"
msgstr "git config [<опція-файлу>] --get-colorbool <назва> [<stdout-is-tty>]"
msgid ""
+"git config get [<file-option>] [<display-option>] [--includes] [--all] [--"
+"regexp=<regexp>] [--value=<value>] [--fixed-value] [--default=<default>] "
+"<name>"
+msgstr ""
+"git config get [<опція-файлу>] [<опція-відображення>] [--includes] [--all] "
+"[--regexp=<регвир>] [--value=<значення>] [--fixed-value] [--default=<за-"
+"замовчуванням>] <назва>"
+
+msgid ""
"git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] "
"[--value=<value>] [--fixed-value] <name> <value>"
msgstr ""
@@ -5574,12 +5605,8 @@ msgid "traversed %lu commits\n"
msgstr "пройдено через %lu комітів\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"знайдено більше %i тегів; показані %i останніх\n"
-"припинено пошук на %s\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "знайдено %i тегів; припинено пошук на %s\n"
#, c-format
msgid "describe %s\n"
@@ -5964,13 +5991,13 @@ msgid ""
"to avoid this check\n"
msgstr ""
"перевірка примусових оновлень зайняла %.2f секунд; ви можете скористатися\n"
-"\"--no-show-forced-updates\" або виконати \"git config fetch."
-"showForcedUpdates false\"\n"
+"\"--no-show-forced-updates\" або виконати \"git config "
+"fetch.showForcedUpdates false\"\n"
"щоб уникнути цієї перевірки\n"
#, c-format
-msgid "%s did not send all necessary objects\n"
-msgstr "%s не надіслав всіх необхідних обʼєктів\n"
+msgid "%s did not send all necessary objects"
+msgstr "%s не надіслав усі необхідні обʼєкти"
#, c-format
msgid "rejected %s because shallow roots are not allowed to be updated"
@@ -6007,8 +6034,8 @@ msgid "option \"%s\" value \"%s\" is not valid for %s"
msgstr "значення \"%s\" опції \"%s\" неприпустиме для %s"
#, c-format
-msgid "option \"%s\" is ignored for %s\n"
-msgstr "опція \"%s\" ігнорується для %s\n"
+msgid "option \"%s\" is ignored for %s"
+msgstr "опція \"%s\" ігнорується для %s"
#, c-format
msgid "%s is not a valid object"
@@ -6018,6 +6045,21 @@ msgstr "%s не є припустимим об’єктом"
msgid "the object %s does not exist"
msgstr "об’єкт %s не існує"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Запустіть \"git remote set-head %s %s\", щоб відстежити зміни, або "
+"встановіть\n"
+"\"remote.%s.followRemoteHEAD\" параметр конфігурації на інше значення\n"
+"якщо ви не хочете бачити це повідомлення. Зокрема, виконання команди\n"
+"\"git config set remote.%s.followRemoteHEAD %s\" вимкне попередження\n"
+"доки віддалений сервер не змінить HEAD на щось інше."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "виявлено кілька гілок, несумісних з --set-upstream"
@@ -6158,6 +6200,9 @@ msgstr "refmap"
msgid "specify fetch refmap"
msgstr "вказати мапу посилань для fetch"
+msgid "revision"
+msgstr "ревізія"
+
msgid "report that we have only objects reachable from this object"
msgstr "звітувати, що у нас є тільки обʼєкти, доступні з цього обʼєкта"
@@ -6212,8 +6257,8 @@ msgid "protocol does not support --negotiate-only, exiting"
msgstr "протокол не підтримує --negotiate-only, вихід"
msgid ""
-"--filter can only be used with the remote configured in extensions."
-"partialclone"
+"--filter can only be used with the remote configured in "
+"extensions.partialclone"
msgstr ""
"--filter можна використовувати лише з віддаленим призначенням, налаштованим "
"у extensions.partialclone"
@@ -6686,6 +6731,9 @@ msgstr "працювати ретельніше (збільшує час вик�
msgid "enable auto-gc mode"
msgstr "увімкнути режим автоматичного збору сміття"
+msgid "perform garbage collection in the background"
+msgstr "виконувати прибирання сміття у фоновому режимі"
+
msgid "force running gc even if there may be another gc running"
msgstr "примусово запускати збирач сміття, навіть якщо інший збирач вже працює"
@@ -6786,6 +6834,9 @@ msgstr "завдання \"%s\" не можна вибрати кілька ра
msgid "run tasks based on the state of the repository"
msgstr "запускати завдання на основі стану сховища"
+msgid "perform maintenance in the background"
+msgstr "виконувати технічне обслуговування у фоновому режимі"
+
msgid "frequency"
msgstr "частота"
@@ -6883,8 +6934,26 @@ msgstr "недоступні ні systemd таймери, ні crontab"
msgid "%s scheduler is not available"
msgstr "%s планувальник недоступний"
-msgid "another process is scheduling background maintenance"
-msgstr "ще один процес планує фонове обслуговування"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"не вдалося створити \"%s.lock\": %s.\n"
+"\n"
+"Здається, у цьому сховищі запущено ще один запланований процес git-"
+"maintenance(1). Будь ласка, переконайтеся, що у сховищі не запущено інших "
+"процесів обслуговування, і\n"
+"і спробуйте ще раз. Якщо все одно не вдасться, можливо, \n"
+"раніше у цьому сховищі аварійно завершився git-maintenance(1) процес: "
+"видаліть файл вручну, щоб продовжити роботу."
+
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "не може отримати блокування для планового фонового обслуговування"
msgid "git maintenance start [--scheduler=<scheduler>]"
msgstr "git maintenance start [--scheduler=<планувальник>]"
@@ -7418,19 +7487,19 @@ msgstr "локальний обʼєкт %s пошкоджено"
#, c-format
msgid "packfile name '%s' does not end with '.%s'"
-msgstr "ім’я файла пакунка '%s' не закінчується на '.%s'"
+msgstr "ім’я файла пакунка \"%s\" не закінчується на '.%s'"
#, c-format
msgid "cannot write %s file '%s'"
-msgstr "неможливо записати %s файл '%s'"
+msgstr "неможливо записати %s файл \"%s\""
#, c-format
msgid "cannot close written %s file '%s'"
-msgstr "неможливо закрити записаний %s файл '%s'"
+msgstr "неможливо закрити записаний %s файл \"%s\""
#, c-format
msgid "unable to rename temporary '*.%s' file to '%s'"
-msgstr "не вдається перейменувати тимчасовий файл '*.%s' на '%s'"
+msgstr "не вдається перейменувати тимчасовий файл \"*.%s\" на \"%s\""
msgid "error while closing pack file"
msgstr "помилка під час закриття файлу пакунка"
@@ -7441,11 +7510,11 @@ msgstr "невірний pack.indexVersion=%<PRIu32>"
#, c-format
msgid "Cannot open existing pack file '%s'"
-msgstr "Неможливо відкрити існуючий файл пакунка '%s"
+msgstr "Неможливо відкрити існуючий файл пакунка \"%s\""
#, c-format
msgid "Cannot open existing pack idx file for '%s'"
-msgstr "Неможливо відкрити існуючий індексний файл пакунка для '%s"
+msgstr "Неможливо відкрити існуючий індексний файл пакунка для \"%s\""
#, c-format
msgid "non delta: %d object"
@@ -7461,6 +7530,20 @@ msgstr[0] "довжина ланцюжка = %d: %lu об’єкт"
msgstr[1] "довжина ланцюжка = %d: %lu об’єкти"
msgstr[2] "довжина ланцюжка = %d: %lu об’єктів"
+msgid "could not start pack-objects to repack local links"
+msgstr "не вдалося розпочати pack-objects для перепакування локальних посилань"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "не вдалося передати локальний обʼєкт до pack-objects"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: очікуються повні рядки шістнадцяткових ідентифікаторів обʼєктів "
+"тільки від pack-objects."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr "не вдалося завершити pack-objects для перепакування локальних посилань"
+
msgid "Cannot come back to cwd"
msgstr "Неможливо повернутися до поточної робочої директорії"
@@ -7470,7 +7553,10 @@ msgstr "невірний %s"
#, c-format
msgid "unknown hash algorithm '%s'"
-msgstr "невідомий хеш-алгоритм '%s'"
+msgstr "невідомий хеш-алгоритм \"%s\""
+
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor не можна використовувати з назвою пакунка"
msgid "--stdin requires a git repository"
msgstr "--stdin потребує наявності git сховища"
@@ -7656,9 +7742,6 @@ msgstr "-L<діапазон>:<файл> не можна використовув
msgid "Final output: %d %s\n"
msgstr "Кінцевий результат: %d %s\n"
-msgid "unable to create temporary object directory"
-msgstr "не вдалося створити тимчасову директорію об’єкта"
-
#, c-format
msgid "git show %s: bad file"
msgstr "git show %s: невірний файл"
@@ -8231,15 +8314,6 @@ msgstr "використовувати злиття на основі diff3"
msgid "use a zealous diff3 based merge"
msgstr "використовувати ретельне злиття на основі diff3"
-msgid "for conflicts, use our version"
-msgstr "у разі конфліктів використовувати нашу версію"
-
-msgid "for conflicts, use their version"
-msgstr "у разі конфліктів використовувати їхню версію"
-
-msgid "for conflicts, use a union version"
-msgstr "у разі конфліктів використовувати об’єднану версію"
-
msgid "<algorithm>"
msgstr "<алгоритм>"
@@ -8709,6 +8783,9 @@ msgstr ""
msgid "write multi-pack bitmap"
msgstr "записати multi-pack bitmap"
+msgid "write a new incremental MIDX"
+msgstr "записати новий інкрементний MIDX"
+
msgid "write multi-pack index containing only given indexes"
msgstr "записати multi-pack індекс, що містить лише задані індекси"
@@ -8843,11 +8920,11 @@ msgstr "git notes [--ref <посилання-нотатки>] [list [<об’є�
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <посилання-нотатки>] add [-f] [--allow-empty] [--"
"[no-]separator|--separator=<розділювач-абзаців>] [--[no-]stripspace] [-m "
-"<допис> | -F <файл> | (-c | -C) <обʼєкт>] [<обʼєкт>]"
+"<допис> | -F <файл> | (-c | -C) <обʼєкт>] [<обʼєкт>] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr ""
@@ -8856,11 +8933,11 @@ msgstr ""
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <посилання-нотатки>] append [--allow-empty] [--"
"[no-]separator|--separator=<розділювач-абзаців>] [--[no-]stripspace] [-m "
-"<допис> | -F <файл> | (-c | -C) <обʼєкт>] [<обʼєкт>]"
+"<допис> | -F <файл> | (-c | -C) <обʼєкт>] [<обʼєкт>] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <посилання-нотатки>] edit [--allow-empty] [<об’єкт>]"
@@ -8979,6 +9056,9 @@ msgstr "вміст нотатки у файлі"
msgid "reuse and edit specified note object"
msgstr "повторно використати та редагувати вказаний обʼєкт нотатки"
+msgid "edit note message in editor"
+msgstr "редагувати допис нотатки в редакторі"
+
msgid "reuse specified note object"
msgstr "повторно використати вказаний обʼєкт нотатки"
@@ -9195,8 +9275,8 @@ msgstr "очікувався обʼєкт на зміщенні %<PRIuMAX> па�
msgid "disabling bitmap writing, packs are split due to pack.packSizeLimit"
msgstr ""
-"вимкнення bitmap запису, пакунки розбиваються на частини через pack."
-"packSizeLimit"
+"вимкнення bitmap запису, пакунки розбиваються на частини через "
+"pack.packSizeLimit"
msgid "Writing objects"
msgstr "Запис обʼєктів"
@@ -9478,6 +9558,9 @@ msgstr "обробка для відсутніх обʼєктів"
msgid "do not pack objects in promisor packfiles"
msgstr "не пакувати обʼєкти у promisor пакунки"
+msgid "implies --missing=allow-any"
+msgstr "мається на увазі --missing=allow-any"
+
msgid "respect islands during delta compression"
msgstr "поважати острови під час дельта компресії"
@@ -9974,7 +10057,7 @@ msgstr "Надсилання до %s\n"
#, c-format
msgid "failed to push some refs to '%s'"
-msgstr "не вдалося надіслати деякі посилання до '%s'"
+msgstr "не вдалося надіслати деякі посилання до \"%s\""
msgid ""
"recursing into submodule with push.recurseSubmodules=only; using on-demand "
@@ -9985,7 +10068,7 @@ msgstr ""
#, c-format
msgid "invalid value for '%s'"
-msgstr "неприпустиме значення для '%s'"
+msgstr "неприпустиме значення для \"%s\""
msgid "repository"
msgstr "сховище"
@@ -10746,6 +10829,9 @@ msgstr "неприпустимий формат посилання: %s"
msgid "git refs migrate --ref-format=<format> [--dry-run]"
msgstr "git refs migrate --ref-format=<формат> [--dry-run]"
+msgid "git refs verify [--strict] [--verbose]"
+msgstr "git refs verify [--strict] [--verbose]"
+
msgid "specify the reference format to convert to"
msgstr "вкажіть формат посилання, в який потрібно конвертувати"
@@ -10759,6 +10845,12 @@ msgstr "відсутній --ref-format=<формат>"
msgid "repository already uses '%s' format"
msgstr "сховище вже використовує формат \"%s\""
+msgid "enable strict checking"
+msgstr "увімкнути сувору перевірку"
+
+msgid "'git refs verify' takes no arguments"
+msgstr "\"git refs verify\" не потребує аргументів"
+
msgid ""
"git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--"
"mirror=<fetch|push>] <name> <url>"
@@ -11100,6 +11192,30 @@ msgstr[0] " Локальне посилання налаштовано для \
msgstr[1] " Локальних посилання налаштовано для \"git push\"%s:"
msgstr[2] " Локальних посилань налаштовано для \"git push\"%s:"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "\"%s/HEAD\" не змінився і вказує на \"%s\"\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "\"%s/HEAD\" змінився з \"%s\" і тепер вказує на \"%s\"\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "Створено \"%s/HEAD\", який вказує на \"%s\"\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "\"%s/HEAD\" був відʼєднаний на \"%s\" і тепер вказує на \"%s\"\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"\"%s/HEAD\" раніше вказував на \"%s\" (який не є віддаленою гілкою), але "
+"тепер вказує на \"%s\"\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr ""
"встановити refs/remotes/<назва>/HEAD відповідно до віддаленого призначення"
@@ -11124,7 +11240,7 @@ msgid "Not a valid ref: %s"
msgstr "Не є припустимим посиланням: %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "Не вдалося налаштувати %s"
#, c-format
@@ -11696,11 +11812,11 @@ msgstr "записати лише той факт, що вилучені шля�
#, c-format
msgid "Failed to resolve '%s' as a valid revision."
-msgstr "Не вдалося розпізнати '%s' як припустиму ревізію."
+msgstr "Не вдалося розпізнати \"%s\" як припустиму ревізію."
#, c-format
msgid "Failed to resolve '%s' as a valid tree."
-msgstr "Не вдалося розпізнати '%s' як припустиме дерево."
+msgstr "Не вдалося розпізнати \"%s\" як припустиме дерево."
msgid "--mixed with paths is deprecated; use 'git reset -- <paths>' instead."
msgstr ""
@@ -11729,7 +11845,7 @@ msgstr ""
#, c-format
msgid "Could not reset index file to revision '%s'."
-msgstr "Не вдалося скинути індексний файл до ревізії '%s'."
+msgstr "Не вдалося скинути індексний файл до ревізії \"%s\"."
msgid "Could not write new index file."
msgstr "Не вдалося записати новий індексний файл."
@@ -12211,11 +12327,11 @@ msgstr "посилання не існує"
msgid "failed to look up reference"
msgstr "не вдалося знайти посилання"
-msgid "only show tags (can be combined with branches)"
-msgstr "показати тільки теги (можна комбінувати з гілками)"
+msgid "only show tags (can be combined with --branches)"
+msgstr "показувати тільки теги (можна комбінувати з --branches)"
-msgid "only show branches (can be combined with tags)"
-msgstr "показати тільки гілки (можна комбінувати з тегами)"
+msgid "only show branches (can be combined with --tags)"
+msgstr "показувати тільки гілки (можна комбінувати з --tags)"
msgid "check for reference existence without resolving"
msgstr "перевіряти наявність посилання без розвʼязання"
@@ -12268,6 +12384,10 @@ msgstr "не вдалося видалити директорію \"%s\""
msgid "failed to create directory for sparse-checkout file"
msgstr "не вдалося створити директорію для файлу розрідженого переходу"
+#, c-format
+msgid "unable to fdopen %s"
+msgstr "не вдалося fdopen %s"
+
msgid "failed to initialize worktree config"
msgstr "не вдалося ініціалізувати конфігурацію робочого дерева"
@@ -12726,8 +12846,8 @@ msgid "couldn't hash object from '%s'"
msgstr "не вдалося хешувати обʼєкт з \"%s\""
#, c-format
-msgid "unexpected mode %o\n"
-msgstr "неочікуваний режим %o\n"
+msgid "unexpected mode %o"
+msgstr "неочікуваний режим %o"
msgid "use the commit stored in the index instead of the submodule HEAD"
msgstr "використати коміт, збережений в індексі, замість підмодуля HEAD"
@@ -12771,8 +12891,8 @@ msgid ""
"Submodule work tree '%s' contains a .git directory. This will be replaced "
"with a .git file by using absorbgitdirs."
msgstr ""
-"Робоче дерево підмодуля \"%s\" містить директорію .git. Її буде замінено на ."
-"git файл за допомогою absorbgitdirs."
+"Робоче дерево підмодуля \"%s\" містить директорію .git. Її буде замінено "
+"на .git файл за допомогою absorbgitdirs."
#, c-format
msgid ""
@@ -13871,6 +13991,9 @@ msgid "try to match the new branch name with a remote-tracking branch"
msgstr ""
"спробуйте співставити нову назву гілки з назвою віддалено відстежуваної гілки"
+msgid "use relative paths for worktrees"
+msgstr "використовувати відносні шляхи для робочих дерев"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "опції \"%s\", \"%s\" та \"%s\" не можна використовувати разом"
@@ -14149,6 +14272,25 @@ msgstr "неможливо створити \"%s\""
msgid "index-pack died"
msgstr "index-pack завершився невдало"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "Директорія \"%s\" присутня в індексі, але не є розрідженою"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "пошкоджене cache-tree має записи, яких немає в індексі"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s з прапорцями 0x%x не слід бути в cache-tree"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "невірне піддерево \"%.*s\""
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr "cache-tree для шляху %.*s не співпадає. Очікувалось %s отримано %s"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "ідентифікатор завершення фрагмента зʼявився раніше, ніж очікувалось"
@@ -15007,16 +15149,16 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Підтримка <GIT_DIR>/info/grafts застаріла\n"
-"і буде вилучена в одній з наступних версій Git.\n"
+"і буде вилучена у наступній версії Git'у.\n"
"\n"
-"Будь ласка, скористайтесь \"git replace --convert-graft-file\"\n"
-"щоб перетворити щепи на заміни посилань.\n"
+"Будь ласка, використовуйте \"git replace --convert-graft-file\"\n"
+"щоб перетворити прищепи на замінювані посилання.\n"
"\n"
"Щоб вимкнути це повідомлення, виконайте\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
#, c-format
msgid "commit %s exists in commit-graph but not in the object database"
@@ -15834,6 +15976,19 @@ msgstr "url не має схеми: %s"
msgid "credential url cannot be parsed: %s"
msgstr "неможливо розібрати url облікових даних: %s"
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "неприпустимий таймаут \"%s\", очікується невідʼємне ціле число"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr ""
+"неприпустимий початковий таймаут \"%s\", очікується невідʼємне ціле число"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "неприпустимі максимальні з'єднання \"%s\", очікується число"
+
msgid "in the future"
msgstr "у майбутньому"
@@ -16552,6 +16707,21 @@ msgstr "невірний шлях до простору імен git \"%s\""
msgid "too many args to run %s"
msgstr "забагато аргументів для запуску %s"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Ви намагаєтеся отримати %s, який знаходиться у файлі коміт-графа, але не в "
+"базі даних обʼєктів.\n"
+"Ймовірно, це повʼязано з пошкодженням репозиторію.\n"
+"Якщо ви намагаєтеся виправити це пошкодження репозиторію повторним "
+"отриманням відсутнього обʼєкта, скористайтеся командою \"git fetch --"
+"refetch\" з відсутнім обʼєктом."
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: очікувався неглибокий список"
@@ -17140,11 +17310,12 @@ 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
-"Гачок \"%s\" було проігноровано, оскільки він не визначений як виконуваний.\n"
-"Ви можете вимкнути це попередження за допомогою \"git config advice."
-"ignoredHook false\"."
+"Гачок \"%s\" було проігноровано, оскільки він не визначений як придатний для "
+"виконання.\n"
+"Ви можете вимкнути це попередження за допомогою \"git config set "
+"advice.ignoredHook false\"."
msgid "not a git repository"
msgstr "не є git сховищем"
@@ -17161,15 +17332,9 @@ msgstr ""
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Контроль делегування не підтримується з cURL < 7.22.0"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "Закріплення відкритих ключів не підтримується з cURL < 7.39.0"
-
msgid "Unknown value for http.proactiveauth"
msgstr "Невідоме значення для http.proactiveauth"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE не підтримується з cURL < 7.44.0"
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "Непідтримуваний SSL обробник \"%s\". Підтримувані SSL обробники:"
@@ -17330,13 +17495,16 @@ msgstr ""
msgid "Unable to create '%s.lock': %s"
msgstr "Не вдалося створити \"%s.lock\": %s"
+msgid "unable to create temporary object directory"
+msgstr "не вдалося створити тимчасову директорію обʼєкта"
+
#, c-format
msgid "could not write loose object index %s"
msgstr "не вдалося записати індекс вільного обʼєкта %s"
#, c-format
-msgid "failed to write loose object index %s\n"
-msgstr "не вдалося записати індекс вільного обʼєкта %s\n"
+msgid "failed to write loose object index %s"
+msgstr "не вдалося записати індекс вільного обʼєкта %s"
#, c-format
msgid "unexpected line: '%s'"
@@ -17353,6 +17521,10 @@ msgid "unable to format message: %s"
msgstr "не вдалося відформатувати допис: %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "неправильний розмір маркера \"%s\", очікується число"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
msgstr "Не вдалося обʼєднати підмодуль %s (не активне)"
@@ -17887,6 +18059,17 @@ msgstr "не вдалося завантажити пакунок"
msgid "could not open index for %s"
msgstr "не вдалося відкрити індекс для %s"
+#, c-format
+msgid "unable to link '%s' to '%s'"
+msgstr "не вдалося звʼязати \"%s\" з \"%s\""
+
+#, c-format
+msgid "failed to clear multi-pack-index at %s"
+msgstr "не вдалося очистити multi-pack-index при %s"
+
+msgid "cannot write incremental MIDX with bitmap"
+msgstr "неможливо записати інкрементний MIDX з bitmap"
+
msgid "ignoring existing multi-pack-index; checksum mismatch"
msgstr ""
"ігнорування існуючого multi-pack-index; невідповідність контрольних сум"
@@ -17916,18 +18099,33 @@ msgstr "немає файлів пакунків для індексації."
msgid "refusing to write multi-pack .bitmap without any objects"
msgstr "відмовлено в записі мультіпакункового .bitmap без обʼєктів"
+msgid "unable to create temporary MIDX layer"
+msgstr "не вдалося створити тимчасовий шар MIDX"
+
msgid "could not write multi-pack bitmap"
msgstr "не вдалося записати мультіпакунковий bitmap"
+msgid "unable to open multi-pack-index chain file"
+msgstr "не вдалося відкрити ланцюжковий файл multi-pack-index"
+
+msgid "unable to rename new multi-pack-index layer"
+msgstr "не вдалося перейменувати новий multi-pack-index шар"
+
msgid "could not write multi-pack-index"
msgstr "не вдалося записати multi-pack-index"
+msgid "cannot expire packs from an incremental multi-pack-index"
+msgstr "неможливо видалити пакунки з інкрементним multi-pack-index"
+
msgid "Counting referenced objects"
msgstr "Підрахунок обʼєктів, на які є посилання"
msgid "Finding and deleting unreferenced packfiles"
msgstr "Пошук і видалення файлів пакунків без посилань"
+msgid "cannot repack an incremental multi-pack-index"
+msgstr "неможливо перепакувати інкрементний multi-pack-index"
+
msgid "could not start pack-objects"
msgstr "не вдалося розпочати pack-objects"
@@ -17990,6 +18188,27 @@ msgstr ""
"multi-pack-index назви пакунків знаходяться у невірній послідовності: \"%s\" "
"перед \"%s\""
+msgid "multi-pack-index chain file too small"
+msgstr "ланцюжковий файл multi-pack-index занадто малий"
+
+#, c-format
+msgid "pack count in base MIDX too high: %<PRIuMAX>"
+msgstr "кількість пакунків у базовому MIDX занадто велика: %<PRIuMAX>"
+
+#, c-format
+msgid "object count in base MIDX too high: %<PRIuMAX>"
+msgstr "кількість обʼєктів у базовому MIDX занадто велика: %<PRIuMAX>"
+
+#, c-format
+msgid "invalid multi-pack-index chain: line '%s' not a hash"
+msgstr "неприпустимий multi-pack-index ланцюжок: рядок \"%s\" не є хешем"
+
+msgid "unable to find all multi-pack index files"
+msgstr "не вдалося знайти всі файли multi-pack-index"
+
+msgid "invalid MIDX object position, MIDX is likely corrupt"
+msgstr "неприпустима позиція MIDX обʼєкта, ймовірно, MIDX пошкоджено"
+
#, c-format
msgid "bad pack-int-id: %u (%u total packs)"
msgstr "невірний pack-int-id: %u (%u всього пакунків)"
@@ -18008,10 +18227,6 @@ msgstr ""
msgid "multi-pack-index large offset out of bounds"
msgstr "large offset 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 "multi-pack-index файл існує, але його не вдалося розібрати"
@@ -18221,6 +18436,14 @@ msgid "missing mapping of %s to %s"
msgstr "відсутнє зіставлення %s до %s"
#, c-format
+msgid "unable to open %s"
+msgstr "не вдалося відкрити %s"
+
+#, c-format
+msgid "files '%s' and '%s' differ in contents"
+msgstr "файли \"%s\" та \"%s\" відрізняються за вмістом"
+
+#, c-format
msgid "unable to write file %s"
msgstr "не вдалося записати файл %s"
@@ -18305,10 +18528,6 @@ 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 "невідповідність хешу для %s (очікувалось %s)"
@@ -18409,7 +18628,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Зазвичай Git ніколи не створює посилання, яке закінчується 40-hex "
"символами,\n"
@@ -18584,13 +18803,6 @@ msgstr "у мультіпакунковому bitmap відсутній необ
msgid "could not open pack %s"
msgstr "не вдалося відкрити пакунок %s"
-msgid "could not determine MIDX preferred pack"
-msgstr "не вдалося визначити бажаний пакунок MIDX"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "бажаний пакунок (%s) є неприпустимим"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "пошкоджена bitmap таблиця пошуку: триплетна позиція поза індексом"
@@ -19223,7 +19435,7 @@ msgstr "багатоступеневі записи для злитого фай
#, c-format
msgid "unordered stage entries for '%s'"
-msgstr "невпорядковані записи індексу для '%s'"
+msgstr "невпорядковані записи індексу для \"%s\""
#, c-format
msgid "unable to create load_cache_entries thread: %s"
@@ -19537,6 +19749,10 @@ msgid "expected format: %%(ahead-behind:<committish>)"
msgstr "очікуваний формат: %%(ahead-behind:<комітоподібне>)"
#, c-format
+msgid "expected format: %%(is-base:<committish>)"
+msgstr "очікуваний формат: %%(is-base:<комітоподібне>)"
+
+#, c-format
msgid "malformed field name: %.*s"
msgstr "невірно сформована назва поля: %.*s"
@@ -19711,18 +19927,26 @@ msgstr "лог для посилання %s несподівано заверш�
msgid "log for %s is empty"
msgstr "лог для %s порожній"
-msgid "refusing to force and skip creation of reflog"
-msgstr "відмовлено в примусовому пропуску створення рефлогу"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "відмовлено в оновленні посилання з невірною назвою \"%s\""
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "відмовлено в оновленні псевдопосилання \"%s\""
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "відмовлено в оновленні псевдопосилання \"%s\""
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "відмовлено в оновленні reflog з невірною назвою \"%s\""
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "відмовлено в оновленні посилання з невірною назвою \"%s\""
+
+msgid "refusing to force and skip creation of reflog"
+msgstr "відмовлено в примусовому пропуску створення рефлогу"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "update_ref завершився невдало для посилання \"%s\": %s"
@@ -19772,6 +19996,17 @@ msgstr ""
"призначенням \"%s\", але це звичайне посилання"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "неможливо прочитати файл посилання \"%s\""
+
+#, c-format
+msgid "cannot open directory %s"
+msgstr "неможливо відкрити директорію %s"
+
+msgid "Checking references consistency"
+msgstr "Перевірка співпадіння посилань"
+
+#, c-format
msgid "refname is dangerous: %s"
msgstr "refname є небезпечним: %s"
@@ -19897,8 +20132,8 @@ msgstr "віддалений сервер надіслав неочікуван�
msgid "unable to rewind rpc post data - try increasing http.postBuffer"
msgstr ""
-"не вдалося перемотати вперед rpc post дані - спробуйте збільшити http."
-"postBuffer"
+"не вдалося перемотати вперед rpc post дані - спробуйте збільшити "
+"http.postBuffer"
#, c-format
msgid "remote-curl: bad line length character: %.4s"
@@ -19973,7 +20208,7 @@ msgstr "remote-curl: невідома команда \"%s\" з git"
#, c-format
msgid "config remote shorthand cannot begin with '/': %s"
-msgstr "скорочення віддаленої конфігураціі не може починатися з '/': %s"
+msgstr "скорочення віддаленої конфігураціі не може починатися з \"/\": %s"
msgid "more than one receivepack given, using the first"
msgstr "надано більше одного пакунка для отримання, використано перший"
@@ -19982,8 +20217,12 @@ msgid "more than one uploadpack given, using the first"
msgstr "надано більше одного пакунка для завантаження, використано перший"
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "нерозпізнане followRemoteHEAD значення \"%s\" було проігноровано"
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
-msgstr "нерозпізнане значення transfer.credentialsInUrl: '%s'"
+msgstr "нерозпізнане значення transfer.credentialsInUrl: \"%s\""
#, c-format
msgid "URL '%s' uses plaintext credentials"
@@ -20003,11 +20242,11 @@ msgstr "%s відстежує як %s, так і %s"
#, c-format
msgid "key '%s' of pattern had no '*'"
-msgstr "ключ '%s' шаблону не містив '*'"
+msgstr "ключ \"%s\" шаблону не містив '*'"
#, c-format
msgid "value '%s' of pattern has no '*'"
-msgstr "значення '%s' шаблону не містить '*'"
+msgstr "значення \"%s\" шаблону не містить '*'"
#, c-format
msgid "src refspec %s does not match any"
@@ -20106,11 +20345,11 @@ msgstr "HEAD не вказує на гілку"
#, c-format
msgid "no such branch: '%s'"
-msgstr "немає такої гілки: '%s'"
+msgstr "немає такої гілки: \"%s\""
#, c-format
msgid "no upstream configured for branch '%s'"
-msgstr "першоджерельне сховище не налаштовано для гілки '%s'"
+msgstr "першоджерельне сховище не налаштовано для гілки \"%s\""
#, c-format
msgid "upstream branch '%s' not stored as a remote-tracking branch"
@@ -20131,7 +20370,7 @@ 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')"
+msgstr "надсилання не має призначення (push.default дорівнює \"nothing\")"
msgid "cannot resolve 'simple' push to a single destination"
msgstr ""
@@ -20184,7 +20423,7 @@ msgstr[0] ""
msgstr[1] ""
"Ваша гілка відстає від \"%s\" на %d коміти, і її можна перемотати вперед.\n"
msgstr[2] ""
-"Ваша гілка відстає від гілки '%s' на %d комітів, і її можна перемотати "
+"Ваша гілка відстає від гілки \"%s\" на %d комітів, і її можна перемотати "
"вперед.\n"
msgid " (use \"git pull\" to update your local branch)\n"
@@ -20219,7 +20458,7 @@ msgstr "неможливо розібрати очікувану назву об
#, c-format
msgid "cannot strip one component off url '%s'"
-msgstr "неможливо вилучити один компонент з url '%s'"
+msgstr "неможливо вилучити один компонент з url \"%s\""
#, c-format
msgid "bad replace ref name: %s"
@@ -20429,12 +20668,15 @@ msgstr ""
msgid "create repository within 'src' directory"
msgstr "створити сховище в директорії \"src\""
+msgid "specify if tags should be fetched during clone"
+msgstr "вказати, чи потрібно отримувати теги під час клонування"
+
msgid ""
"scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n"
-"\t[--[no-]src] <url> [<enlistment>]"
+"\t[--[no-]src] [--[no-]tags] <url> [<enlistment>]"
msgstr ""
"scalar clone [--single-branch] [--branch <головна-гілка>] [--full-clone]\n"
-"\t[--[no-]src] <URL-адреса> [<коренева-директорія>]"
+"\t[--[no-]src] [--[no-]tags] <URL-адреса> [<коренева-директорія-проекту>]"
#, c-format
msgid "cannot deduce worktree name from '%s'"
@@ -20453,6 +20695,10 @@ msgid "could not configure remote in '%s'"
msgstr "не вдалося налаштувати віддалене сховище в \"%s\""
#, c-format
+msgid "could not disable tags in '%s'"
+msgstr "не вдалося вимкнути теги в \"%s\""
+
+#, c-format
msgid "could not configure '%s'"
msgstr "не вдалося налаштувати \"%s\""
@@ -20983,7 +21229,7 @@ msgid ""
msgstr ""
"\"reword\" не приймає коміти злиття. Якщо ви хочете\n"
"відтворити злиття та змінити текст допису, використовуйте\n"
-"\"merge -c\" для коміта."
+"\"merge -c\" для коміта"
#. TRANSLATORS: 'edit', 'merge -C' and 'break' should
#. not be translated.
@@ -21526,6 +21772,10 @@ msgid "failed to stat '%*s%s%s'"
msgstr "не вдалося записати \"%*s%s%s\""
#, c-format
+msgid "safe.directory '%s' not absolute"
+msgstr "safe.directory \"%s\" не є абсолютною"
+
+#, c-format
msgid ""
"detected dubious ownership in repository at '%s'\n"
"%sTo add an exception for this directory, call:\n"
@@ -21863,7 +22113,7 @@ msgstr "Не вдалося оновити підмодуль \"%s\"."
#, c-format
msgid "submodule git dir '%s' is inside git dir '%.*s'"
-msgstr "підмодуль git dir \"%s\" знаходиться всередині git директорії \"%*s\""
+msgstr "підмодуль git dir \"%s\" знаходиться всередині git директорії \"%.*s\""
#, c-format
msgid "expected '%.*s' in submodule path '%s' not to be a symbolic link"
@@ -21936,6 +22186,9 @@ msgstr "коміт %s не позначений як досяжний"
msgid "too many commits marked reachable"
msgstr "забагато комітів позначено як досяжні"
+msgid "could not determine MIDX preferred pack"
+msgstr "не вдалося визначити бажаний пакунок MIDX"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<опції>]"
@@ -22001,6 +22254,24 @@ msgstr "токен"
msgid "command token to send to the server"
msgstr "токен команди для відправки на сервер"
+msgid "unit-test [<options>]"
+msgstr "unit-test [<опції>]"
+
+msgid "immediately exit upon the first failed test"
+msgstr "вихід відразу після першого невдалого тесту"
+
+msgid "suite[::test]"
+msgstr "suite[::test]"
+
+msgid "run only test suite or individual test <suite[::test]>"
+msgstr "запустити тільки набір тестів або окремий тест <suite[::test]>"
+
+msgid "suite"
+msgstr "набір"
+
+msgid "exclude test suite <suite>"
+msgstr "виключити набір тестів <suite>"
+
#, c-format
msgid "running trailer command '%s' failed"
msgstr "не вдалося виконати команду трейлера \"%s\""
@@ -22580,6 +22851,9 @@ msgstr ".git файл пошкоджено"
msgid ".git file incorrect"
msgstr ".git файл не є коректним"
+msgid ".git file absolute/relative path mismatch"
+msgstr "неспівпадіння абсолютного/відносного шляху до .git файлу"
+
msgid "not a valid path"
msgstr "неприпустимий шлях"
@@ -22595,6 +22869,9 @@ msgstr "не вдалося знайти сховище; файл .git пошк�
msgid "gitdir unreadable"
msgstr "нечитабельна git директорія"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "неспівпадіння абсолютного/відносного шляху git директорії"
+
msgid "gitdir incorrect"
msgstr "невірна git директорія"
@@ -22630,6 +22907,13 @@ msgstr "не вдалося скинути %s в \"%s\""
msgid "failed to set extensions.worktreeConfig setting"
msgstr "не вдалося встановити extensions.worktreeConfig параметр"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"не вдалося оновити формат сховища для підтримки відносних робочих дерев"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "не вдалося встановити параметр extensions.relativeWorktrees"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "не вдалося встановити змінну оточення \"%s\""
@@ -22965,7 +23249,7 @@ msgstr ""
#, c-format
msgid "You are currently bisecting, started from branch '%s'."
-msgstr "Наразі ви робите бісекцію, починаючи з гілки '%s'."
+msgstr "Наразі ви робите бісекцію, починаючи з гілки \"%s\"."
msgid "You are currently bisecting."
msgstr "Наразі ви робите бісекцію."
@@ -23198,6 +23482,9 @@ msgstr "\"%s.final\" містить створений лист.\n"
msgid "--dump-aliases incompatible with other options\n"
msgstr "--dump-aliases несумісна з іншими опціями\n"
+msgid "--dump-aliases and --translate-aliases are mutually exclusive\n"
+msgstr "--dump-aliases і --translate-aliases є взаємовиключними\n"
+
msgid ""
"fatal: found configuration options for 'sendmail'\n"
"git-send-email is configured with the sendemail.* options - note the 'e'.\n"
@@ -23370,8 +23657,8 @@ msgstr ""
" Наведений вище список копій було розширено додатковими\n"
" адресами, знайденими у дописі до коміту латки. Зазвичай\n"
" send-email запитує перед надсиланням, коли це трапляється.\n"
-" Цю поведінку можна контролювати за допомогою параметра sendemail."
-"confirm\n"
+" Цю поведінку можна контролювати за допомогою параметра "
+"sendemail.confirm\n"
" налаштування конфігурації.\n"
"\n"
" Для отримання додаткової інформації виконайте команду \"git send-email --"
diff --git a/po/vi.po b/po/vi.po
index 00008b50f5..80a5f191a8 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -4,11 +4,11 @@
# https://raw.githubusercontent.com/git-l10n/git-po/pot/main/po/git.pot
# ---
# Copyright (C) 2012-2022, Translation Project, Vietnamese Team <http://translationproject.org/team/vi.html>
-# Copyright (C) 2024, Vũ Tiến Hưng <newcomerminecraft@gmail.com>
+# Copyright (C) 2024-2025, Vũ Tiến Hưng <newcomerminecraft@gmail.com>
# Nguyễn Thái Ngọc Duy <pclouds@gmail.com>, 2012.
# Đoàn Trần Công Danh <congdanhqx@gmail.com>, 2020.
# Trần Ngọc Quân <vnwildman@gmail.com>, 2012-2022.
-# Vũ Tiến Hưng <newcomerminecraft@gmail.com>, 2024.
+# Vũ Tiến Hưng <newcomerminecraft@gmail.com>, 2024-2025.
# ---
# BẢNG THUẬT NGỮ / TERMINOLOGY
# Updated: 2024-07-26, git 2.46
@@ -64,10 +64,10 @@
# +------------------------------------------------------------------+
msgid ""
msgstr ""
-"Project-Id-Version: git 2.47\n"
+"Project-Id-Version: git 2.48\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2024-10-05 01:20+0000\n"
-"PO-Revision-Date: 2024-10-05 16:48+0700\n"
+"POT-Creation-Date: 2024-12-23 18:57+0000\n"
+"PO-Revision-Date: 2025-01-05 01:20+0700\n"
"Last-Translator: Vũ Tiến Hưng <newcomerminecraft@gmail.com>\n"
"Language-Team: Vietnamese <https://github.com/Nekosha/git-po>\n"
"Language: vi\n"
@@ -686,10 +686,10 @@ msgstr "Chỉ có các tập tin nhị phân thay đổi."
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"Tắt lời nhắn này bằng \"git config advice.%s false\""
+"Tắt lời nhắn này bằng \"git config set advice.%s false\""
#, c-format
msgid "%shint:%s%.*s%s\n"
@@ -1904,7 +1904,7 @@ msgid "update tracked files"
msgstr "cập nhật các tập tin được theo dõi"
msgid "renormalize EOL of tracked files (implies -u)"
-msgstr "thường hóa lại EOL của các tập tin được theo dõi (ngụ ý -u)"
+msgstr "thường hóa lại EOL của các tập tin được theo dõi (ngầm chỉ định -u)"
msgid "record only the fact that the path will be added later"
msgstr "chỉ ghi lại sự việc mà đường dẫn sẽ được thêm vào sau"
@@ -2017,7 +2017,7 @@ msgstr "không hiểu cú pháp %s"
#, c-format
msgid "'%s' was deleted by the applypatch-msg hook"
-msgstr "'%s' bị xóa bởi móc applypatch-msg"
+msgstr "'%s' bị xóa bởi hook applypatch-msg"
#, c-format
msgid "Malformed input line: '%s'."
@@ -3040,11 +3040,11 @@ msgid "HEAD not found below refs/heads!"
msgstr "Không tìm thấy HEAD ở dưới refs/heads!"
msgid ""
-"branch with --recurse-submodules can only be used if submodule."
-"propagateBranches is enabled"
+"branch with --recurse-submodules can only be used if "
+"submodule.propagateBranches is enabled"
msgstr ""
-"nhánh với --recurse-submodules chỉ có thể được sử dụng nếu submodule."
-"propagateBranches được kích hoạt"
+"nhánh với --recurse-submodules chỉ có thể được sử dụng nếu "
+"submodule.propagateBranches được kích hoạt"
msgid "--recurse-submodules can only be used to create branches"
msgstr "--recurse-submodules chỉ có thể được sử dụng để tạo ra các nhánh"
@@ -3125,7 +3125,7 @@ msgid "libc info: "
msgstr "thông tin libc: "
msgid "not run from a git repository - no hooks to show\n"
-msgstr "không chạy từ một kho git - nên chẳng có móc nào để hiển thị cả\n"
+msgstr "không chạy từ một kho git - nên chẳng có hook nào để hiển thị cả\n"
msgid ""
"git bugreport [(-o | --output-directory) <path>]\n"
@@ -3200,7 +3200,7 @@ msgid "System Info"
msgstr "Thông tin hệ thống"
msgid "Enabled Hooks"
-msgstr "Các Móc đã được bật"
+msgstr "Các hook đã được bật"
#, c-format
msgid "unable to write to %s"
@@ -3880,8 +3880,8 @@ msgstr "nhánh chưa sinh mới"
msgid "update ignored files (default)"
msgstr "cập nhật các tập tin bị bỏ qua (mặc định)"
-msgid "do not check if another worktree is holding the given ref"
-msgstr "không kiểm tra nếu cây làm việc khác đang giữ tham chiếu đã cho"
+msgid "do not check if another worktree is using this branch"
+msgstr "không kiểm tra nếu cây làm việc khác đang sử dụng nhánh này"
msgid "checkout our version for unmerged files"
msgstr "checkout phiên bản của ta cho các tập tin chưa được hòa trộn"
@@ -4129,7 +4129,7 @@ msgid "create a bare repository"
msgstr "tạo kho bare"
msgid "create a mirror repository (implies --bare)"
-msgstr "tạo kho bản sao (ngụ ý --bare)"
+msgstr "tạo kho bản sao (ngầm chỉ định --bare)"
msgid "to clone from a local repository"
msgstr "để nhân bản từ kho nội bộ"
@@ -4182,11 +4182,11 @@ msgstr "tạo bản sao không đầy đủ cho mức sâu đã cho"
msgid "create a shallow clone since a specific time"
msgstr "tạo bản sao không đầy đủ từ thời điểm đã cho"
-msgid "revision"
-msgstr "điểm xét duyệt"
+msgid "ref"
+msgstr "ref"
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "làm sâu hơn lịch sử của bản sao shallow, bằng điểm xét duyệt loại trừ"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "làm sâu hơn lịch sử của bản sao shallow, loại trừ tham chiếu"
msgid "clone only one branch, HEAD or --branch"
msgstr "chỉ nhân bản một nhánh, HEAD hoặc --branch"
@@ -5068,7 +5068,7 @@ msgid "commit only specified files"
msgstr "chỉ chuyển giao các tập tin đã chỉ ra"
msgid "bypass pre-commit and commit-msg hooks"
-msgstr "vòng qua móc (hook) pre-commit và commit-msg"
+msgstr "bỏ qua hook pre-commit và commit-msg"
msgid "show what would be committed"
msgstr "hiển thị xem cái gì có thể được chuyển giao"
@@ -5077,7 +5077,7 @@ msgid "amend previous commit"
msgstr "'tu bổ' (amend) lần commit trước"
msgid "bypass post-rewrite hook"
-msgstr "vòng qua móc (hook) post-rewrite"
+msgstr "bỏ qua hook post-rewrite"
msgid "ok to record an empty change"
msgstr "ok để ghi lại một thay đổi trống rỗng"
@@ -5143,10 +5143,10 @@ msgstr ""
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
"git config unset [<tuỳ-chọn>] [--all] [--value=<giá-trị>] [--fixed-value] "
-"<khoá> <giá-trị>"
+"<khoá>"
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
msgstr "git config rename-section [<tuỳ-chọn>] <tên-cũ> <tên-mới>"
@@ -5579,12 +5579,8 @@ msgid "traversed %lu commits\n"
msgstr "đã xuyên %lu qua lần chuyển giao\n"
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"tìm thấy nhiều hơn %i thẻ; đã liệt kê %i cái gần\n"
-"đây nhất bỏ đi tìm kiếm tại %s\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "tìm thấy %i thẻ; từ bỏ tìm kiếm tại %s\n"
#, c-format
msgid "describe %s\n"
@@ -6020,6 +6016,19 @@ msgstr "%s không phải là một đối tượng hợp lệ"
msgid "the object %s does not exist"
msgstr "đối tượng '%s' không tồn tại"
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"Chạy 'git remote set-head %s %s' để làm theo thay đổi, hoặc đặt tuỳ chọn\n"
+"'remote.%s.followRemoteHEAD' sang giá trị khác nếu bạn không muốn thấy\n"
+"thông báo này. Cụ thể, 'git config set remote.%s.followRemoteHEAD %s'\n"
+"sẽ vô hiệu cảnh báo này tới khi máy chủ đổi HEAD về chỗ khác."
+
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "phát hiện nhiều nhánh, không tương thích với --set-upstream"
@@ -6157,6 +6166,9 @@ msgstr "refmap"
msgid "specify fetch refmap"
msgstr "chỉ ra refmap cần lấy về"
+msgid "revision"
+msgstr "điểm xét duyệt"
+
msgid "report that we have only objects reachable from this object"
msgstr "báo rằng ta chỉ có các đối tượng tiếp cận được từ đối tượng này"
@@ -6209,11 +6221,11 @@ msgid "protocol does not support --negotiate-only, exiting"
msgstr "giao thức không hỗ trợ --negotiate-only, nên thoát"
msgid ""
-"--filter can only be used with the remote configured in extensions."
-"partialclone"
+"--filter can only be used with the remote configured in "
+"extensions.partialclone"
msgstr ""
-"--filter chỉ có thể được dùng với máy chủ được cấu hình bằng extensions."
-"partialclone"
+"--filter chỉ có thể được dùng với máy chủ được cấu hình bằng "
+"extensions.partialclone"
msgid "--atomic can only be used when fetching from one remote"
msgstr "--atomic chỉ có thể dùng khi lấy về từ một máy chủ"
@@ -6882,8 +6894,24 @@ msgstr "hoặc là bộ lập lịch systemd hoặc là crontab không sẵn có
msgid "%s scheduler is not available"
msgstr "bộ lên lịch %s không sẵn có"
-msgid "another process is scheduling background maintenance"
-msgstr "một tiến trình khác được lập kế hoạch chạy nền để bảo trì"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"Không thể tạo '%s.lock': %s.\n"
+"\n"
+"Tiến trình git-maintenance(1) khác có lẽ đang chạy ở kho này. Vui lòng\n"
+"chắc chắn rằng mọi tiến trình đã kết thúc và sau đó thử lại. Nếu vẫn lỗi,\n"
+"một tiến trình git-maintenance(1) có lẽ đã crash ở kho này trước đó:\n"
+"gõ bỏ tập tin thủ công để tiếp tục."
+
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "không thể lấy được lock để bảo trì nền theo kế hoạch"
msgid "git maintenance start [--scheduler=<scheduler>]"
msgstr "git maintenance start [--scheduler=<bộ lên lịch>]"
@@ -7250,8 +7278,8 @@ msgid ""
"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
"args>]"
msgstr ""
-"git hook run [--ignore-missing] [--to-stdin=</đường/dẫn/>] <tên-móc> [-- "
-"<các tham số cho móc>]"
+"git hook run [--ignore-missing] [--to-stdin=</đường/dẫn/>] <tên-hook> [-- "
+"<các tham số cho hook>]"
msgid "silently ignore missing requested <hook-name>"
msgstr "âm thầm bỏ qua các <hook-name> đã yêu cầu còn thiếu"
@@ -7445,6 +7473,20 @@ msgid "chain length = %d: %lu object"
msgid_plural "chain length = %d: %lu objects"
msgstr[0] "chiều dài chuỗi = %d: %lu đối tượng"
+msgid "could not start pack-objects to repack local links"
+msgstr "không thể bắt đầu pack-objects để đóng gói lại các link cục bộ"
+
+msgid "failed to feed local object to pack-objects"
+msgstr "gặp lỗi khi đưa local object cho pack-objects"
+
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack: Đang chỉ cần các dòng ID đối tượng dạng hexa đầy đủ từ pack-"
+"objects."
+
+msgid "could not finish pack-objects to repack local links"
+msgstr "không thể hoàn tất pack-objects để đóng gói các link cục bộ"
+
msgid "Cannot come back to cwd"
msgstr "Không thể quay lại thư mục hiện hành"
@@ -7456,6 +7498,9 @@ msgstr "%s sai"
msgid "unknown hash algorithm '%s'"
msgstr "không hiểu thuật toán băm dữ liệu '%s'"
+msgid "--promisor cannot be used with a pack name"
+msgstr "không được dùng --promisor với tên pack"
+
msgid "--stdin requires a git repository"
msgstr "--stdin cần một kho git"
@@ -8101,7 +8146,8 @@ msgid "use full path names"
msgstr "dùng tên đường dẫn đầy đủ"
msgid "list entire tree; not just current directory (implies --full-name)"
-msgstr "liệt kê cây mục tin; không chỉ thư mục hiện hành (ngụ ý --full-name)"
+msgstr ""
+"liệt kê cây mục tin; không chỉ thư mục hiện hành (ngầm chỉ định --full-name)"
msgid "--format can't be combined with other format-altering options"
msgstr ""
@@ -8390,10 +8436,10 @@ msgid "continue the current in-progress merge"
msgstr "tiếp tục quá trình hòa trộn hiện tại đang thực hiện"
msgid "bypass pre-merge-commit and commit-msg hooks"
-msgstr "vòng qua móc (hook) pre-merge-commit và commit-msg"
+msgstr "bỏ qua hook pre-merge-commit và commit-msg"
msgid "could not run stash."
-msgstr "không thể chạy stash."
+msgstr "không thể chạy tạm cất."
msgid "stash failed"
msgstr "lệnh tạm cất gặp lỗi"
@@ -8815,11 +8861,11 @@ msgstr "git notes [--ref <notes-ref>] [list [<đối-tượng>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <lời-nhắn> | -F <tập-"
-"tin> | (-c | -C) <đối-tượng>] [<đối-tượng>]"
+"tin> | (-c | -C) <đối-tượng>] [<đối-tượng>] [-e]"
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
msgstr "git notes [--ref <notes-ref>] copy [-f] <từ-đối-tượng> <đến-đối-tượng>"
@@ -8827,11 +8873,11 @@ msgstr "git notes [--ref <notes-ref>] copy [-f] <từ-đối-tượng> <đến-�
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <lời-nhắn> | -F <tập-"
-"tin> | (-c | -C) <đối-tượng>] [<đối-tượng>]"
+"tin> | (-c | -C) <đối-tượng>] [<đối-tượng>] [-e]"
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
msgstr "git notes [--ref <notes-ref>] edit [--allow-empty] [<đối-tượng>]"
@@ -8950,6 +8996,9 @@ msgstr "nội dung ghi chú (note) nằm trong một tập tin"
msgid "reuse and edit specified note object"
msgstr "dùng lại nhưng có sửa chữa đối tượng note đã chỉ ra"
+msgid "edit note message in editor"
+msgstr "sửa lại chú thích trong trình soạn thảo"
+
msgid "reuse specified note object"
msgstr "dùng lại đối tượng ghi chú (note) đã chỉ ra"
@@ -8988,7 +9037,7 @@ msgid "read objects from stdin"
msgstr "đọc các đối tượng từ stdin"
msgid "load rewriting config for <command> (implies --stdin)"
-msgstr "tải cấu hình chép lại cho <lệnh> (ngụ ý --stdin)"
+msgstr "tải cấu hình chép lại cho <lệnh> (ngầm chỉ định --stdin)"
msgid "too few arguments"
msgstr "quá ít đối số"
@@ -9355,7 +9404,7 @@ msgid "limit pack window by memory in addition to object limit"
msgstr "giới hạn cửa sổ đóng gói theo bộ nhớ cộng thêm với giới hạn đối tượng"
msgid "maximum length of delta chain allowed in the resulting pack"
-msgstr "độ dài tối đa của chuỗi móc xích 'delta' được phép trong gói kết quả"
+msgstr "độ dài tối đa của chuỗi delta được phép trong gói kết quả"
msgid "reuse existing deltas"
msgstr "dùng lại các delta sẵn có"
@@ -9448,8 +9497,11 @@ msgstr "xử lý cho thiếu đối tượng"
msgid "do not pack objects in promisor packfiles"
msgstr "không thể đóng gói các đối tượng trong các tập tin gói promisor"
+msgid "implies --missing=allow-any"
+msgstr "ngầm chỉ định --missing=allow-any"
+
msgid "respect islands during delta compression"
-msgstr "tôn trọng island trong suốt quá trình nén 'delta'"
+msgstr "tôn trọng island trong suốt quá trình nén delta"
msgid "protocol"
msgstr "giao thức"
@@ -9584,7 +9636,7 @@ msgid "allow fast-forward"
msgstr "cho phép chuyển-tiếp-nhanh"
msgid "control use of pre-merge-commit and commit-msg hooks"
-msgstr "điều khiển cách dùng các móc (hook) pre-merge-commit và commit-msg"
+msgstr "điều khiển cách dùng các hook pre-merge-commit và commit-msg"
msgid "automatically stash/stash pop before and after"
msgstr "tự động stash/stash pop trước và sau"
@@ -9785,8 +9837,8 @@ msgid ""
msgstr ""
"\n"
"Để tránh tự động cấu hình nhánh thượng nguồn khi tên của chúng\n"
-"không khớp với nhánh nội bộ, xem tùy chọn 'simple' của branch."
-"autoSetupMerge\n"
+"không khớp với nhánh nội bộ, xem tùy chọn 'simple' của "
+"branch.autoSetupMerge\n"
"trong 'git help config'.\n"
#, c-format
@@ -9994,7 +10046,7 @@ msgid "prune locally removed refs"
msgstr "xén tỉa những tham chiếu bị gỡ bỏ"
msgid "bypass pre-push hook"
-msgstr "vòng qua móc tiền-đẩy (pre-push)"
+msgstr "bỏ qua hook tiền-đẩy (pre-push)"
msgid "push missing but relevant tags"
msgstr "push phần bị thiếu nhưng các thẻ lại thích hợp"
@@ -10289,10 +10341,10 @@ msgid "use the merge-base of upstream and branch as the current base"
msgstr "sử dụng gốc hòa trộn của thượng nguồn và nhánh làm gốc hiện tại"
msgid "allow pre-rebase hook to run"
-msgstr "cho phép móc (hook) pre-rebase được chạy"
+msgstr "cho phép hook pre-rebase được chạy"
msgid "be quiet. implies --no-stat"
-msgstr "im lặng. ngụ ý --no-stat"
+msgstr "im lặng. ngầm chỉ định --no-stat"
msgid "display a diffstat of what changed upstream"
msgstr "hiển thị diffstat của những thay đổi thượng nguồn"
@@ -10526,14 +10578,14 @@ msgid "Current branch %s is up to date.\n"
msgstr "Nhánh hiện tại %s đã được cập nhật rồi.\n"
msgid "HEAD is up to date, rebase forced."
-msgstr "HEAD hiện đã được cập nhật rồi, bị ép buộc rebase."
+msgstr "HEAD hiện đã được cập nhật rồi, ép buộc rebase."
#, c-format
msgid "Current branch %s is up to date, rebase forced.\n"
-msgstr "Nhánh hiện tại %s đã được cập nhật rồi, lệnh rebase ép buộc.\n"
+msgstr "Nhánh hiện tại %s đã được cập nhật rồi, ép buộc rebase.\n"
msgid "The pre-rebase hook refused to rebase."
-msgstr "Móc (hook) pre-rebase từ chối rebase."
+msgstr "Hook pre-rebase từ chối rebase."
#, c-format
msgid "Changes to %s:\n"
@@ -10546,7 +10598,7 @@ msgstr "Thay đổi từ %s thành %s:\n"
#, c-format
msgid "First, rewinding head to replay your work on top of it...\n"
msgstr ""
-"Trước tiên, di chuyển head để xem lại các công việc trên đỉnh của nó...\n"
+"Trước tiên, di chuyển lại head để thực hiện lại các thay đổi trên nó...\n"
msgid "Could not detach HEAD"
msgstr "Không thể tách rời HEAD"
@@ -11048,6 +11100,29 @@ msgid " Local ref configured for 'git push'%s:"
msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " Những tham chiếu nội bộ được cấu hình cho lệnh 'git push'%s:"
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "'%s/HEAD' không đổi và trỏ đến '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' đã đổi từ '%s' để trỏ đến '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "'%s/HEAD' đã tạo và trỏ đến '%s'\n"
+
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' đã tách ra ở '%s' và trỏ đến '%s'\n"
+
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr ""
+"'%s/HEAD' từng trỏ đến '%s' (không phải nhánh máy chủ) và giờ trỏ đến '%s'\n"
+
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "đặt refs/remotes/<tên>/HEAD cho phù hợp với máy chủ"
@@ -11069,7 +11144,7 @@ msgid "Not a valid ref: %s"
msgstr "Không phải là tham chiếu hợp lệ: %s"
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "Không thể cài đặt %s"
#, c-format
@@ -12955,7 +13030,7 @@ msgid "don't print cloning progress"
msgstr "đừng in tiến trình nhân bản"
msgid "disallow cloning into non-empty directory, implies --init"
-msgstr "không cho phép nhân bản vào thư mục trống, ngụ ý --init"
+msgstr "không cho phép nhân bản vào thư mục trống, ngầm chỉ định --init"
msgid ""
"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
@@ -13778,6 +13853,9 @@ msgstr "cài đặt chế độ theo dõi (xem git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "có khớp tên tên nhánh mới với một nhánh theo dõi máy chủ"
+msgid "use relative paths for worktrees"
+msgstr "dùng đường dẫn tương đối cho thư mục làm việc"
+
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
msgstr "tùy chọn '%s', '%s' và '%s' không thể dùng cùng nhau"
@@ -14049,6 +14127,25 @@ msgstr "không thể tạo '%s'"
msgid "index-pack died"
msgstr "index-pack đã chết"
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "Thư mục '%s' có ở trong chỉ mục, mà không phải dạng sparse?"
+
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "cache-tree bị hỏng, chứa mục không có trong chỉ mục"
+
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "%s với cờ 0x%x không nên có trong cache-tree"
+
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "subtree sai '%.*s'"
+
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr "cache-tree cho đường dẫn %.*s không khớp. Cần %s nhưng có %s"
+
msgid "terminating chunk id appears earlier than expected"
msgstr "id chunk kết thúc sớm hơn bình thường"
@@ -14264,7 +14361,7 @@ msgid "Display help information about Git"
msgstr "Hiển thị thông tin trợ giúp về Git"
msgid "Run git hooks"
-msgstr "Chạy các móc git"
+msgstr "Chạy các hook git"
msgid "Server side implementation of Git over HTTP"
msgstr "Hỗ trợ phía máy chủ của Git qua HTTP"
@@ -14930,7 +15027,7 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"Hỗ trợ cho <GIT_DIR>/info/grafts đã không còn\n"
"và sẽ bị xóa bỏ ở phiên bản Git tương lai.\n"
@@ -14939,7 +15036,7 @@ msgstr ""
"để chuyển đổi các graft thành các tham chiếu thay thế.\n"
"\n"
"Tắt lời nhắn này bằng cách chạy\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
#, c-format
msgid "commit %s exists in commit-graph but not in the object database"
@@ -15750,6 +15847,18 @@ msgstr "url không có lược đồ: %s"
msgid "credential url cannot be parsed: %s"
msgstr "không hiểu cú pháp giấy chứng thực url: %s"
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "timeout không hợp lệ '%s', cần số nguyên không âm"
+
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr "init-timeout không hợp lệ '%s', cần số nguyên không âm"
+
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "max-connections không hợp lệ '%s', cần số nguyên"
+
msgid "in the future"
msgstr "ở tương lai"
@@ -16445,6 +16554,20 @@ msgstr "đường dẫn không gian tên git \"%s\" sai"
msgid "too many args to run %s"
msgstr "quá nhiều tham số để chạy %s"
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"Bạn đang muốn lấy về %s, nằm trong tập tin đồ-thị-chuyển-giao nhưng nằm "
+"ngoài cơ sở dữ liệu đối tượng.\n"
+"Nhiều khả năng kho chứa đã bị hỏng.\n"
+"Nếu bạn đang cần sửa chữa lại kho chứa bằng cách lấy về đối tượng còn thiếu, "
+"dùng 'git fetch --refetch' với đối tượng đó."
+
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack: cần danh sách shallow"
@@ -16878,8 +17001,8 @@ msgid ""
"given pattern contains NULL byte (via -f <file>). This is only supported "
"with -P under PCRE v2"
msgstr ""
-"mẫu đã cho có chứa NULL byte (qua -f <file>). Điều này chỉ được hỗ trợ với -"
-"P dưới PCRE v2"
+"mẫu đã cho có chứa NULL byte (qua -f <file>). Điều này chỉ được hỗ trợ với "
+"-P dưới PCRE v2"
#, c-format
msgid "'%s': unable to read %s"
@@ -17023,10 +17146,10 @@ msgstr[0] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
-"Móc '%s' bị bỏ qua bởi vì nó không có cờ thực thi được.\n"
-"Bạn có thể tắt cảnh báo này bằng 'git config advice.ignoredHook false'."
+"Hook '%s' bị bỏ qua bởi vì nó không có cờ thực thi được.\n"
+"Bạn có thể tắt cảnh báo này bằng 'git config set advice.ignoredHook false'."
msgid "not a git repository"
msgstr "không phải là kho git"
@@ -17042,15 +17165,9 @@ msgstr "giá trị âm cho http.postBuffer; đặt thành mặc định là %d"
msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "Điều khiển giao quyền không được hỗ trợ với cURL < 7.22.0"
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "Chốt khóa công không được hỗ trợ với cURL < 7.39.0"
-
msgid "Unknown value for http.proactiveauth"
msgstr "không hiểu giá trị cho http.proactiveauth"
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "CURLSSLOPT_NO_REVOKE không được hỗ trợ với cURL < 7.44.0"
-
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr ""
@@ -17204,7 +17321,7 @@ msgstr ""
"Tiến trình git khác có lẽ đang chạy ở kho này, ví dụ\n"
"một trình soạn thảo được mở bởi 'git commit'. Vui lòng chắc chắn\n"
"rằng mọi tiến trình đã kết thúc và sau đó thử lại. Nếu vẫn lỗi,\n"
-"một tiến trình git có lẽ đã crash khi thực hiện ở kho này trước đó:\n"
+"một tiến trình git có lẽ đã crash ở kho này trước đó:\n"
"gõ bỏ tập tin một cách thủ công để tiếp tục."
#, c-format
@@ -17237,8 +17354,12 @@ msgid "unable to format message: %s"
msgstr "không thể định dạng thông điệp: %s"
#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "marker-size không hợp lệ '%s', cần số nguyên"
+
+#, c-format
msgid "Failed to merge submodule %s (not checked out)"
-msgstr "Gặp lỗi khi hòa trộn mô-đun-con %s (không checkout được)"
+msgstr "Gặp lỗi khi hòa trộn mô-đun-con %s (không checkout)"
#, c-format
msgid "Failed to merge submodule %s (no merge base)"
@@ -18335,7 +18456,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Git thường không bao giờ tạo tham chiếu kết thúc với 40 ký tự hex\n"
"bởi vì nó sẽ bị bỏ qua khi bạn chỉ định 40 ký tự hex. Những tham chiếu\n"
@@ -18344,8 +18465,8 @@ msgstr ""
" git switch -c $br $(git rev-parse ...)\n"
"\n"
"với \"$br\" không hiểu lý do vì sao rỗng và tạo ra tham chiếu 40-hex.\n"
-" Xin hãy kiểm tra những tham chiếu này và xóa chúng đi nếu cần. Tắt\n"
-"lời nhắn này bằng cách chạy lệnh \"git config advice.objectNameWarning "
+"Xin hãy kiểm tra những tham chiếu này và xóa chúng đi nếu cần. Tắt\n"
+"lời nhắn này bằng cách chạy lệnh \"git config set advice.objectNameWarning "
"false\""
#, c-format
@@ -18502,13 +18623,6 @@ msgstr "bitmap multi-pack thiếu chỉ mục để dành cần thiết"
msgid "could not open pack %s"
msgstr "không thể mở gói '%s'"
-msgid "could not determine MIDX preferred pack"
-msgstr "không thể xác định gói MIDX ưa dùng"
-
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "preferred pack (%s) không hợp lệ"
-
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "bảng tìm kiếm bitmap bị hỏng: vị trí bộ ba nằm ngoài chỉ mục"
@@ -19619,18 +19733,26 @@ msgstr "nhật ký cho tham chiếu %s kết thúc bất ngờ trên %s"
msgid "log for %s is empty"
msgstr "nhật ký cho %s trống rỗng"
-msgid "refusing to force and skip creation of reflog"
-msgstr "từ chối bỏ qua việc tạo log tham chiếu"
-
#, c-format
-msgid "refusing to update ref with bad name '%s'"
-msgstr "từ chối cập nhật tham chiếu với tên sai '%s'"
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "từ chối cập nhật reflog cho tham chiếu ảo '%s'"
#, c-format
msgid "refusing to update pseudoref '%s'"
msgstr "từ chối cập nhật tham chiếu ảo '%s'"
#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "từ chối cập nhật reflog với tên sai '%s'"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "từ chối cập nhật tham chiếu với tên sai '%s'"
+
+msgid "refusing to force and skip creation of reflog"
+msgstr "từ chối bỏ qua việc tạo log tham chiếu"
+
+#, c-format
msgid "update_ref failed for ref '%s': %s"
msgstr "update_ref bị lỗi cho ref '%s': %s"
@@ -19642,7 +19764,7 @@ msgid "ref updates forbidden inside quarantine environment"
msgstr "cập nhật tham chiếu bị cấm trong môi trường kiểm tra"
msgid "ref updates aborted by hook"
-msgstr "các cập nhật tham chiếu bị huỷ bỏ bởi móc"
+msgstr "các cập nhật tham chiếu bị huỷ bỏ bởi hook"
#, c-format
msgid "'%s' exists; cannot create '%s'"
@@ -19680,6 +19802,10 @@ msgstr ""
"tham chiếu thường"
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "không thể đọc tập tin ref '%s'"
+
+#, c-format
msgid "cannot open directory %s"
msgstr "không thể mở thư mục %s"
@@ -19887,6 +20013,10 @@ msgid "more than one uploadpack given, using the first"
msgstr "đã đưa ra nhiều hơn một gói tải lên, đang sử dụng cái đầu tiên"
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "bỏ qua giá trị không chấp nhận cho followRemoteHEAD '%s'"
+
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "không chấp nhận giá trị transfer.credentialsInUrl: '%s'"
@@ -20650,7 +20780,7 @@ msgstr ""
" git rebase --continue\n"
msgid "'prepare-commit-msg' hook failed"
-msgstr "móc 'prepare-commit-msg' bị lỗi"
+msgstr "hook 'prepare-commit-msg' bị lỗi"
msgid ""
"Your name and email address were configured automatically based\n"
@@ -21812,6 +21942,9 @@ msgstr "lần chuyển giao %s chưa được đánh dấu là tiếp cận đư
msgid "too many commits marked reachable"
msgstr "có quá nhiều lần chuyển giao được đánh dấu là tiếp cận được"
+msgid "could not determine MIDX preferred pack"
+msgstr "không thể xác định gói MIDX ưa dùng"
+
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<các tùy chọn>]"
@@ -22478,6 +22611,9 @@ msgstr "tập tin .git bị hỏng"
msgid ".git file incorrect"
msgstr "tập tin .git không chính xác"
+msgid ".git file absolute/relative path mismatch"
+msgstr "đường dẫn tương đối/tuyệt đối đến file .git không khớp"
+
msgid "not a valid path"
msgstr "không phải là một đường dẫn hợp lệ"
@@ -22493,6 +22629,9 @@ msgstr "không thể định vị kho chứa; tập tin .git bị hỏng"
msgid "gitdir unreadable"
msgstr "gitdir không thể đọc được"
+msgid "gitdir absolute/relative path mismatch"
+msgstr "đường dẫn tương đối/tuyệt đối đến gitdir không khớp"
+
msgid "gitdir incorrect"
msgstr "gitdir không chính xác"
@@ -22527,6 +22666,13 @@ msgstr "không thể bỏ đặt %s trong '%s'"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "gặp lỗi khi đặt cài đặt extensions.worktreeConfig"
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr ""
+"không thể nâng cấp định định dạng kho chứa để hỗ trợ cây làm việc tương đối"
+
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "gặp lỗi khi đặt cài đặt extensions.relativeWorktrees"
+
#, c-format
msgid "could not setenv '%s'"
msgstr "không thể setenv '%s'"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 55d2aee627..12a0fb510b 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -154,8 +154,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2024-10-05 03:31+0800\n"
-"PO-Revision-Date: 2024-10-05 03:32+0800\n"
+"POT-Creation-Date: 2025-01-02 20:43+0800\n"
+"PO-Revision-Date: 2025-01-05 19:01+0800\n"
"Last-Translator: Teng Long <dyroneteng@gmail.com>\n"
"Language-Team: GitHub <https://github.com/dyrone/git/>\n"
"Language: zh_CN\n"
@@ -886,10 +886,10 @@ msgstr "只有二进制文件被修改。"
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"使用 \"git config advice.%s false\" 来关闭此消息"
+"使用 \"git config set advice.%s false\" 来关闭此消息"
#: advice.c
#, c-format
@@ -1778,9 +1778,10 @@ msgstr "不是一个有效的对象名:%s"
msgid "not a tree object: %s"
msgstr "不是一个树对象:%s"
-#: archive.c builtin/clone.c
-msgid "unable to checkout working tree"
-msgstr "不能检出工作区"
+#: archive.c
+#, c-format
+msgid "failed to unpack tree object %s"
+msgstr "无法解包树对象 %s"
#: archive.c
#, c-format
@@ -1957,7 +1958,7 @@ msgstr "忽略过大的 gitattributes 数据对象 '%s'"
#: attr.c
msgid "cannot use --attr-source or GIT_ATTR_SOURCE without repo"
-msgstr "无法在没有存储库的情况下使用 --attr-source 或 GIT_ATTR_SOURCE"
+msgstr "无法在没有仓库的情况下使用 --attr-source 或 GIT_ATTR_SOURCE"
#: attr.c
msgid "bad --attr-source or GIT_ATTR_SOURCE"
@@ -4813,7 +4814,7 @@ msgstr "未知的冲突风格 '%s'"
msgid "perform a 3-way merge with the new branch"
msgstr "和新的分支执行三方合并"
-#: builtin/checkout.c builtin/log.c parse-options.h
+#: builtin/checkout.c builtin/log.c builtin/range-diff.c parse-options.h
msgid "style"
msgstr "风格"
@@ -4842,8 +4843,8 @@ msgid "update ignored files (default)"
msgstr "更新忽略的文件(默认)"
#: builtin/checkout.c
-msgid "do not check if another worktree is holding the given ref"
-msgstr "不检查指定的引用是否被其他工作区所占用"
+msgid "do not check if another worktree is using this branch"
+msgstr "不检查其他工作区是否正在使用该分支"
#: builtin/checkout.c
msgid "checkout our version for unmerged files"
@@ -5222,14 +5223,13 @@ msgstr "创建一个指定深度的浅克隆"
msgid "create a shallow clone since a specific time"
msgstr "从一个特定时间创建一个浅克隆"
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/rebase.c
-#: builtin/replay.c
-msgid "revision"
-msgstr "版本"
+#: builtin/clone.c builtin/fetch.c builtin/pull.c
+msgid "ref"
+msgstr "引用"
#: builtin/clone.c builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "深化浅克隆的历史,除了特定版本"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "深化浅克隆的历史,除了给定的引用"
#: builtin/clone.c builtin/submodule--helper.c
msgid "clone only one branch, HEAD or --branch"
@@ -5391,6 +5391,10 @@ msgid "remote HEAD refers to nonexistent ref, unable to checkout"
msgstr "远程 HEAD 指向一个不存在的引用,无法检出"
#: builtin/clone.c
+msgid "unable to checkout working tree"
+msgstr "不能检出工作区"
+
+#: builtin/clone.c
msgid "unable to write parameters to config file"
msgstr "无法将参数写入配置文件"
@@ -6368,10 +6372,9 @@ msgstr ""
#: builtin/config.c
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
-"git config unset [<文件选项>] [--all] [--value=<值>] [--fixed-value] <名称> <"
-"值>"
+"git config unset [<文件选项>] [--all] [--value=<值>] [--fixed-value] <名称>"
#: builtin/config.c
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
@@ -6915,12 +6918,8 @@ msgstr "已遍历 %lu 个提交\n"
#: builtin/describe.c
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"发现多于 %i 个标签,列出最近的 %i 个\n"
-"在 %s 放弃搜索\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "找到 %i 个标签;在 %s 处放弃搜索\n"
#: builtin/describe.c
#, c-format
@@ -7469,6 +7468,21 @@ msgid "the object %s does not exist"
msgstr "对象 '%s' 不存在"
#: builtin/fetch.c
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"运行 'git remote set-head %s %s' 以跟随更改,或者\n"
+"如果您不想看到此消息,则将'remote.%s.followRemoteHEAD' 配置选项设置为不同的"
+"值。\n"
+"特别地,运行 'git config set remote.%s.followRemoteHEAD %s' 将禁用警告,直到"
+"远程将 HEAD 更改为其他内容。\""
+
+#: builtin/fetch.c
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "检测到多分支,和 --set-upstream 不兼容"
@@ -7635,6 +7649,10 @@ msgstr "引用映射"
msgid "specify fetch refmap"
msgstr "指定获取操作的引用映射"
+#: builtin/fetch.c builtin/pull.c builtin/rebase.c builtin/replay.c
+msgid "revision"
+msgstr "版本"
+
#: builtin/fetch.c builtin/pull.c
msgid "report that we have only objects reachable from this object"
msgstr "报告我们只拥有从该对象开始可达的对象"
@@ -7830,7 +7848,7 @@ msgstr "存储着仓库路径列表的配置项键名"
#: builtin/for-each-repo.c
msgid "keep going even if command fails in a repository"
-msgstr "即使存储库中的命令失败,仍继续执行"
+msgstr "即使仓库中的命令失败,仍继续执行"
#: builtin/for-each-repo.c
msgid "missing --config=<config>"
@@ -8546,8 +8564,24 @@ msgid "%s scheduler is not available"
msgstr "%s 调度器不可用"
#: builtin/gc.c
-msgid "another process is scheduling background maintenance"
-msgstr "另外一个进程正运行于后台维护"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"无法创建 '%s.lock':%s。\n"
+"\n"
+"另一个已计划的 git-maintenance(1) 进程似乎正在该仓库中运行。\n"
+"请确保没有其他维护进程正在运行,然后重试。如果仍然运行失败,则\n"
+"git-maintenance(1) 进程可能之前已在此仓库中崩溃:请手动删除该文件以继续。"
+
+#: builtin/gc.c
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "无法获取计划的后台维护锁"
#: builtin/gc.c
msgid "git maintenance start [--scheduler=<scheduler>]"
@@ -9273,6 +9307,23 @@ msgstr[0] "链长 = %d: %lu 对象"
msgstr[1] "链长 = %d: %lu 对象"
#: builtin/index-pack.c
+msgid "could not start pack-objects to repack local links"
+msgstr "无法启动 pack-objects 来重新打包本地链接"
+
+#: builtin/index-pack.c
+msgid "failed to feed local object to pack-objects"
+msgstr "无法将本地对象提供给 pack-objects"
+
+#: builtin/index-pack.c
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+"index-pack:期望仅从 pack-objects 的输出行中获得完整的十六进制对象 ID。"
+
+#: builtin/index-pack.c
+msgid "could not finish pack-objects to repack local links"
+msgstr "无法完成 pack-objects 来重新打包本地链接"
+
+#: builtin/index-pack.c
msgid "Cannot come back to cwd"
msgstr "无法返回当前工作目录"
@@ -9287,6 +9338,10 @@ msgid "unknown hash algorithm '%s'"
msgstr "未知的哈希算法 '%s'"
#: builtin/index-pack.c
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor 无法与包名称一起使用"
+
+#: builtin/index-pack.c
msgid "--stdin requires a git repository"
msgstr "--stdin 需要 git 仓库"
@@ -11002,11 +11057,11 @@ msgstr "git notes [--ref <注解引用>] [list [<对象>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <注解引用>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<分段符>] [--[no-]stripspace] [-m <说明> | -F <文件> | (-c | -C) <"
-"对象>] [<对象>]"
+"对象>] [<对象>] [-e]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
@@ -11016,11 +11071,11 @@ msgstr "git notes [--ref <注解引用>] copy [-f] <源对象> <目标对象>"
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <注解引用>] append [--allow-empty] [--[no-]separator|--"
"separator=<分段符>] [--[no-]stripspace] [-m <说明> | -F <文件> | (-c | -C) <"
-"对象>] [<对象>]"
+"对象>] [<对象>] [-e]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
@@ -11172,6 +11227,10 @@ msgid "reuse and edit specified note object"
msgstr "重用和编辑指定的注解对象"
#: builtin/notes.c
+msgid "edit note message in editor"
+msgstr "在编辑器中编辑注释说明"
+
+#: builtin/notes.c
msgid "reuse specified note object"
msgstr "重用指定的注解对象"
@@ -11785,6 +11844,10 @@ msgid "do not pack objects in promisor packfiles"
msgstr "不要打包 promisor 包文件中的对象"
#: builtin/pack-objects.c
+msgid "implies --missing=allow-any"
+msgstr "暗含 --missing=allow-any"
+
+#: builtin/pack-objects.c
msgid "respect islands during delta compression"
msgstr "在增量压缩时参考数据岛"
@@ -13669,6 +13732,33 @@ msgstr[0] " 为 'git push' 配置的本地引用%s:"
msgstr[1] " 为 'git push' 配置的本地引用%s:"
#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "'%s/HEAD' 未改变并指向 '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' 已从 '%s' 更改,现在指向 '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "'%s/HEAD' 现已创建并指向 '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "'%s/HEAD' 在 '%s' 处分离并且现在指向 '%s'\n"
+
+#: builtin/remote.c
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr "'%s/HEAD' 曾指向 '%s'(不是远程分支),但现在指向 '%s'\n"
+
+#: builtin/remote.c
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "根据远程设置 refs/remotes/<名称>/HEAD"
@@ -13696,7 +13786,7 @@ msgstr "不是一个有效引用:%s"
#: builtin/remote.c
#, c-format
-msgid "Could not setup %s"
+msgid "Could not set up %s"
msgstr "不能设置 %s"
# 译者:注意保持前导空格
@@ -17034,6 +17124,10 @@ msgstr "设置跟踪模式(参见 git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "尝试为新分支名匹配一个远程跟踪分支"
+#: builtin/worktree.c
+msgid "use relative paths for worktrees"
+msgstr "对工作区使用相对路径"
+
#: builtin/worktree.c diff.c parse-options.c
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
@@ -17370,6 +17464,30 @@ msgstr "不能创建 '%s'"
msgid "index-pack died"
msgstr "index-pack 终止"
+#: cache-tree.c
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "目录 '%s' 存在于索引中,但不是稀疏的"
+
+#: cache-tree.c unpack-trees.c
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "损坏的缓存树包含索引中不存在的条目"
+
+#: cache-tree.c
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "标志位为 0x%2$x 的 %1$s 不应位于缓存树中"
+
+#: cache-tree.c
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "损坏的子树 '%.*s'"
+
+#: cache-tree.c
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr "路径 %.*s 的缓存树不匹配。预期为 %s,实际为 %s"
+
#: chunk-format.c
msgid "terminating chunk id appears earlier than expected"
msgstr "终止块 ID 比预期更早出现"
@@ -18477,15 +18595,15 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"对 <GIT_DIR>/info/grafts 的支持已过时,并将在\n"
"未来的Git版本中被移除。\n"
"\n"
"请使用 \"git replace --convert-graft-file\" 将\n"
-"grafts 转换为替换引用。\n"
+"(提交)移植转换为替换引用。\n"
"\n"
-"设置 \"git config advice.graftFileDeprecated false\"\n"
+"运行 \"git config set advice.graftFileDeprecated false\"\n"
"可关闭本消息"
#: commit.c
@@ -19485,6 +19603,21 @@ msgstr "URL 没有 scheme:%s"
msgid "credential url cannot be parsed: %s"
msgstr "不能解析凭据 URL:%s"
+#: daemon.c
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "无效的超时值 '%s',应为非负整数"
+
+#: daemon.c
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr "无效的初始超时值 '%s',应为非负整数"
+
+#: daemon.c
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "无效的最大连接数 '%s',应为一个整数"
+
#: date.c
msgid "in the future"
msgstr "在将来"
@@ -20352,6 +20485,20 @@ msgid "too many args to run %s"
msgstr "执行 %s 的参数太多"
#: fetch-pack.c
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"您正在尝试获取 %s,它位于提交图文件中,但不在对象数据库中。\n"
+"这可能是由于仓库损坏造成的。\n"
+"如果您尝试通过重新获取丢失的对象来修复此仓库损坏,请对丢失的对象使用 'git "
+"fetch --refetch'。"
+
+#: fetch-pack.c
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack:应为 shallow 列表"
@@ -21062,10 +21209,10 @@ msgstr[1] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
"因为没有将钩子 '%s' 设置为可执行,钩子被忽略。您可以通过\n"
-"配置 `git config advice.ignoredHook false` 来关闭这条警告。"
+"配置 `git config set advice.ignoredHook false` 来关闭这条警告。"
#: http-fetch.c
msgid "not a git repository"
@@ -21086,18 +21233,10 @@ msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "不支持委托控制,因为 cURL < 7.22.0"
#: http.c
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "不支持公钥文件锁定,因为 cURL < 7.39.0"
-
-#: http.c
msgid "Unknown value for http.proactiveauth"
msgstr "http.proactiveauth 为未知取值"
#: http.c
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "不支持 CURLSSLOPT_NO_REVOKE,因为 cURL < 7.44.0"
-
-#: http.c
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "不支持的 SSL 后端 '%s'。支持的 SSL 后端:"
@@ -21316,6 +21455,11 @@ msgstr "检测到被引用的 CRLF"
msgid "unable to format message: %s"
msgstr "无法格式化消息:%s"
+#: merge-ll.c
+#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "无效的标记大小 '%s',应为一个整数"
+
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
@@ -22623,7 +22767,7 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
"Git 通常不会创建一个以40个十六进制字符结尾的引用,因为当您只提供40\n"
"个十六进制字符时将被忽略。这些引用可能被错误地创建。例如:\n"
@@ -22631,7 +22775,7 @@ msgstr ""
" git switch -c $br $(git rev-parse ...)\n"
"\n"
"当 \"$br\" 某种原因空白时,一个40位十六进制的引用将被创建。请检查这些\n"
-"引用,可能需要删除它们。运行 \"git config advice.objectNameWarning\n"
+"引用,可能需要删除它们。运行 \"git config set advice.objectNameWarning\n"
"false\" 命令关闭本消息通知。"
#: object-name.c
@@ -22826,15 +22970,6 @@ msgstr "多包位图缺少必需的反向索引"
msgid "could not open pack %s"
msgstr "不能打开包 %s"
-#: pack-bitmap.c t/helper/test-read-midx.c
-msgid "could not determine MIDX preferred pack"
-msgstr "不能确定多包索引的首选包"
-
-#: pack-bitmap.c
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "首选包 (%s) 无效"
-
#: pack-bitmap.c
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "损坏的位图查询表:三元组位置超出索引"
@@ -24170,8 +24305,19 @@ msgid "log for %s is empty"
msgstr "%s 的日志为空"
#: refs.c
-msgid "refusing to force and skip creation of reflog"
-msgstr "拒绝既强制又跳过创建引用日志"
+#, c-format
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "拒绝为伪引用 '%s' 更新引用日志"
+
+#: refs.c
+#, c-format
+msgid "refusing to update pseudoref '%s'"
+msgstr "拒绝更新伪引用 '%s'"
+
+#: refs.c
+#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "拒绝使用错误名称 '%s' 更新引用日志"
#: refs.c
#, c-format
@@ -24179,9 +24325,8 @@ msgid "refusing to update ref with bad name '%s'"
msgstr "拒绝更新有错误名称 '%s' 的引用"
#: refs.c
-#, c-format
-msgid "refusing to update pseudoref '%s'"
-msgstr "拒绝更新伪引用 '%s'"
+msgid "refusing to force and skip creation of reflog"
+msgstr "拒绝强制跳过创建引用日志"
#: refs.c
#, c-format
@@ -24244,6 +24389,11 @@ msgstr "无法锁定引用 '%s':预期目标为 '%s' 的符号引用:但是�
#: refs/files-backend.c
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "无法读取引用文件 '%s'"
+
+#: refs/files-backend.c
+#, c-format
msgid "cannot open directory %s"
msgstr "无法打开目录 %s"
@@ -24500,6 +24650,11 @@ msgstr "提供了一个以上的 uploadpack,使用第一个"
#: remote.c
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "已忽略无法识别的 followRemoteHEAD 值 '%s'"
+
+#: remote.c
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
msgstr "无法识别的 transfer.credentialsInUrl 值:'%s'"
@@ -26810,6 +26965,10 @@ msgstr "提交 %s 没有标记为可达"
msgid "too many commits marked reachable"
msgstr "太多提交标记为可达"
+#: t/helper/test-read-midx.c
+msgid "could not determine MIDX preferred pack"
+msgstr "不能确定多包索引的首选包"
+
#: t/helper/test-serve-v2.c
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<选项>]"
@@ -27585,6 +27744,10 @@ msgid ".git file incorrect"
msgstr ".git 文件不正确"
#: worktree.c
+msgid ".git file absolute/relative path mismatch"
+msgstr ".git 文件绝对/相对路径不匹配"
+
+#: worktree.c
msgid "not a valid path"
msgstr "不是一个有效的路径"
@@ -27605,6 +27768,10 @@ msgid "gitdir unreadable"
msgstr "gitdir 不可读"
#: worktree.c
+msgid "gitdir absolute/relative path mismatch"
+msgstr "gitdir 绝对/相对路径不匹配"
+
+#: worktree.c
msgid "gitdir incorrect"
msgstr "gitdir 不正确"
@@ -27648,6 +27815,14 @@ msgstr "无法在 '%2$s' 中取消设置 %1$s"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "无法设置 extensions.worktreeConfig"
+#: worktree.c
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr "无法升级仓库格式以支持相对工作区"
+
+#: worktree.c
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "无法设定 extensions.relativeWorktrees 的设置"
+
#: wrapper.c
#, c-format
msgid "could not setenv '%s'"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 5e6818f453..a61f544304 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -30,8 +30,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Git\n"
"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2024-10-05 01:20+0000\n"
-"PO-Revision-Date: 2024-10-05 15:45+0800\n"
+"POT-Creation-Date: 2024-12-28 13:16+0800\n"
+"PO-Revision-Date: 2024-12-28 13:23+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"
@@ -764,10 +764,10 @@ msgstr "只有二進位檔案更動了。"
#, c-format
msgid ""
"\n"
-"Disable this message with \"git config advice.%s false\""
+"Disable this message with \"git config set advice.%s false\""
msgstr ""
"\n"
-"請使用「git config advice.%s false」停用此訊息"
+"請使用「git config set advice.%s false」停用此訊息"
#: advice.c
#, c-format
@@ -941,12 +941,12 @@ msgstr "引數過多"
#: apply.c
#, c-format
msgid "unrecognized whitespace option '%s'"
-msgstr "空白字元選項「%s」無法識別"
+msgstr "空白字元選項「%s」不認識"
#: apply.c
#, c-format
msgid "unrecognized whitespace ignore option '%s'"
-msgstr "空白字元忽略選項「%s」無法識別"
+msgstr "空白字元忽略選項「%s」不認識"
#: apply.c archive.c builtin/add.c builtin/branch.c builtin/checkout-index.c
#: builtin/checkout.c builtin/clean.c builtin/clone.c builtin/commit.c
@@ -1081,7 +1081,7 @@ msgstr "二進位修補檔在第 %d 列損壞:%.*s"
#: apply.c
#, c-format
msgid "unrecognized binary patch at line %d"
-msgstr "第 %d 列的二進位修補檔無法識別"
+msgstr "第 %d 列的二進位修補檔不認識"
#: apply.c
#, c-format
@@ -2620,7 +2620,7 @@ msgstr ""
#: builtin/am.c builtin/reset.c
#, c-format
msgid "Could not parse object '%s'."
-msgstr "無法解析「%s」物件。"
+msgstr "無法解析物件「%s」。"
#: builtin/am.c
msgid "failed to clean index"
@@ -2917,7 +2917,7 @@ msgstr "「%s」不是有效的提交"
#, c-format
msgid ""
"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
-msgstr "不能簽出原始 HEAD「%s」。請嘗試「git bisect reset <commit>」。"
+msgstr "無法簽出原始 HEAD「%s」。請嘗試「git bisect reset <commit>」。"
#: builtin/bisect.c
#, c-format
@@ -3021,7 +3021,7 @@ msgstr "「 」不是有效術語"
#: builtin/bisect.c
#, c-format
msgid "unrecognized option: '%s'"
-msgstr "無法識別選項:「%s」"
+msgstr "不認識選項:「%s」"
#: builtin/bisect.c
#, c-format
@@ -3460,7 +3460,7 @@ msgstr "無法解析格式化字串"
#: builtin/branch.c
msgid "could not resolve HEAD"
-msgstr "無法解析 HEAD 指標"
+msgstr "無法解析 HEAD"
#: builtin/branch.c
#, c-format
@@ -4689,7 +4689,7 @@ msgstr "未知的衝突輸出風格「%s」"
msgid "perform a 3-way merge with the new branch"
msgstr "和新分支進行三方合併"
-#: builtin/checkout.c builtin/log.c parse-options.h
+#: builtin/checkout.c builtin/log.c builtin/range-diff.c parse-options.h
msgid "style"
msgstr "style"
@@ -4718,8 +4718,8 @@ msgid "update ignored files (default)"
msgstr "更新忽略的檔案(預設值)"
#: builtin/checkout.c
-msgid "do not check if another worktree is holding the given ref"
-msgstr "不檢查其他工作區是否正在佔用指定的引用"
+msgid "do not check if another worktree is using this branch"
+msgstr "不檢查其他工作區是否正在使用此分支"
#: builtin/checkout.c
msgid "checkout our version for unmerged files"
@@ -4875,7 +4875,7 @@ 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"
@@ -5099,14 +5099,13 @@ msgstr "建立指定深度的淺層複製"
msgid "create a shallow clone since a specific time"
msgstr "建立從指定時間到現在的淺層複製"
-#: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/rebase.c
-#: builtin/replay.c
-msgid "revision"
-msgstr "revision"
+#: builtin/clone.c builtin/fetch.c builtin/pull.c
+msgid "ref"
+msgstr "ref"
#: builtin/clone.c builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone, excluding rev"
-msgstr "取得更多淺層複製的過去歷史記錄,除了特定修訂版"
+msgid "deepen history of shallow clone, excluding ref"
+msgstr "取得更多淺層複製的過往歷史記錄,除了特定修訂版"
#: builtin/clone.c builtin/submodule--helper.c
msgid "clone only one branch, HEAD or --branch"
@@ -5325,12 +5324,12 @@ msgstr "工作區 '%s' 已經存在。"
#: builtin/clone.c builtin/difftool.c builtin/log.c builtin/worktree.c
#, c-format
msgid "could not create leading directories of '%s'"
-msgstr "不能為 '%s' 建立先導目錄"
+msgstr "無法為「%s」建立前導目錄"
#: builtin/clone.c
#, c-format
msgid "could not create work tree dir '%s'"
-msgstr "不能建立工作區目錄 '%s'"
+msgstr "無法建立工作區目錄「%s」"
#: builtin/clone.c
#, c-format
@@ -5495,7 +5494,7 @@ msgstr "無法開啟提交圖鏈「%s」"
#: builtin/commit-graph.c
#, c-format
msgid "unrecognized --split argument, %s"
-msgstr "無法識別的 --split 參數,%s"
+msgstr "不認識的 --split 參數,%s"
#: builtin/commit-graph.c
#, c-format
@@ -5789,12 +5788,12 @@ msgstr "(正從標準輸入中讀取日誌訊息)\n"
#: builtin/commit.c
msgid "could not read log from standard input"
-msgstr "不能從標準輸入中讀取日誌訊息"
+msgstr "無法從標準輸入中讀取記錄"
#: builtin/commit.c
#, c-format
msgid "could not read log file '%s'"
-msgstr "不能讀取日誌檔案 '%s'"
+msgstr "無法讀取日誌檔案「%s」"
#: builtin/commit.c
#, c-format
@@ -5803,11 +5802,11 @@ msgstr "「%s」和「%s:%s」選項不得同時使用"
#: builtin/commit.c
msgid "could not read SQUASH_MSG"
-msgstr "不能讀取 SQUASH_MSG"
+msgstr "無法讀取 SQUASH_MSG"
#: builtin/commit.c
msgid "could not read MERGE_MSG"
-msgstr "不能讀取 MERGE_MSG"
+msgstr "無法讀取 MERGE_MSG"
#: builtin/commit.c bundle.c rerere.c sequencer.c
#, c-format
@@ -5816,7 +5815,7 @@ msgstr "無法開啟「%s」"
#: builtin/commit.c
msgid "could not write commit template"
-msgstr "不能寫提交範本"
+msgstr "無法寫入提交模板"
#: builtin/commit.c
#, c-format
@@ -6192,7 +6191,7 @@ msgstr "允許空的提交說明"
#: builtin/commit.c sequencer.c
msgid "could not parse HEAD commit"
-msgstr "不能解析 HEAD 提交"
+msgstr "無法解析 HEAD 提交"
#: builtin/commit.c
#, c-format
@@ -6201,12 +6200,12 @@ msgstr "損壞的 MERGE_HEAD 檔案(%s)"
#: builtin/commit.c
msgid "could not read MERGE_MODE"
-msgstr "不能讀取 MERGE_MODE"
+msgstr "無法讀取 MERGE_MODE"
#: builtin/commit.c
#, c-format
msgid "could not read commit message: %s"
-msgstr "不能讀取提交說明:%s"
+msgstr "無法讀取提交說明:%s"
#: builtin/commit.c
#, c-format
@@ -6255,10 +6254,10 @@ msgstr ""
#: builtin/config.c
msgid ""
"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
-"<name> <value>"
+"<name>"
msgstr ""
-"git config unset [<檔案選項>] [--all] [--value=<值>] [--fixed-value] <名稱> <"
-"值>"
+"git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] "
+"<name>"
#: builtin/config.c
msgid "git config rename-section [<file-option>] <old-name> <new-name>"
@@ -6390,7 +6389,7 @@ msgstr "除了顯示組態值,額外顯示其鍵名"
#: builtin/config.c
#, c-format
msgid "unrecognized --type argument, %s"
-msgstr "無法識別的 --type 參數,%s"
+msgstr "不認識的 --type 參數,%s"
#: builtin/config.c
msgid "only one type at a time"
@@ -6804,12 +6803,8 @@ msgstr "已遍歷 %lu 個提交\n"
#: builtin/describe.c
#, c-format
-msgid ""
-"more than %i tags found; listed %i most recent\n"
-"gave up search at %s\n"
-msgstr ""
-"發現多於 %i 個標籤,列出最近的 %i 個\n"
-"在 %s 放棄搜尋\n"
+msgid "found %i tags; gave up search at %s\n"
+msgstr "找到 %i 個標籤;在 %s 放棄搜尋\n"
#: builtin/describe.c
#, c-format
@@ -6997,7 +6992,7 @@ msgstr "工作區檔案被留了下來。"
#: builtin/difftool.c sequencer.c
#, c-format
msgid "could not copy '%s' to '%s'"
-msgstr "不能複製 '%s' 至 '%s'"
+msgstr "無法將「%s」複製到「%s」"
#: builtin/difftool.c
#, c-format
@@ -7358,6 +7353,21 @@ msgid "the object %s does not exist"
msgstr "%s 物件不存在"
#: builtin/fetch.c
+#, c-format
+msgid ""
+"Run 'git remote set-head %s %s' to follow the change, or set\n"
+"'remote.%s.followRemoteHEAD' configuration option to a different value\n"
+"if you do not want to see this message. Specifically running\n"
+"'git config set remote.%s.followRemoteHEAD %s' will disable the warning\n"
+"until the remote changes HEAD to something else."
+msgstr ""
+"執行「git remote set-head %s %s」以追蹤這個變更,或者\n"
+"如果您不想看到這則訊息,請將「remote.%s.followRemoteHEAD」\n"
+"組態選項設定成不同的值。更具體些來說,執行\n"
+"「git config set remote.%s.followRemoteHEAD %s」會停用這個警告,\n"
+"直到遠端將 HEAD 變更為其他內容。"
+
+#: builtin/fetch.c
msgid "multiple branches detected, incompatible with --set-upstream"
msgstr "檢測到多分支,和 --set-upstream 不相容"
@@ -7397,12 +7407,12 @@ msgstr "正在取得 %s\n"
#: builtin/fetch.c
#, c-format
msgid "could not fetch %s"
-msgstr "不能取得 %s"
+msgstr "無法取得 %s"
#: builtin/fetch.c
#, c-format
msgid "could not fetch '%s' (exit code: %d)\n"
-msgstr "無法取得 '%s'(離開碼:%d)\n"
+msgstr "無法取得「%s」(離開碼:%d)\n"
#: builtin/fetch.c
msgid ""
@@ -7527,6 +7537,10 @@ msgstr "引用映射"
msgid "specify fetch refmap"
msgstr "指定取得動作的引用映射"
+#: builtin/fetch.c builtin/pull.c builtin/rebase.c builtin/replay.c
+msgid "revision"
+msgstr "revision"
+
#: builtin/fetch.c builtin/pull.c
msgid "report that we have only objects reachable from this object"
msgstr "報告我們只擁有從該物件開始可以取得的物件"
@@ -7788,18 +7802,18 @@ msgstr "懸空 %s %s"
#: builtin/fsck.c
msgid "could not create lost-found"
-msgstr "不能建立 lost-found"
+msgstr "無法建立 lost-found"
#: builtin/fsck.c builtin/gc.c builtin/rebase.c rebase-interactive.c rerere.c
#: sequencer.c
#, c-format
msgid "could not write '%s'"
-msgstr "不能寫入 '%s'"
+msgstr "無法寫入「%s」"
#: builtin/fsck.c
#, c-format
msgid "could not finish '%s'"
-msgstr "不能完成 '%s'"
+msgstr "無法完成「%s」"
#: builtin/fsck.c
#, c-format
@@ -8069,7 +8083,7 @@ msgstr "無法啟動 fsmonitor 監聽執行緒"
#: builtin/fsmonitor--daemon.c
msgid "could not start fsmonitor health thread"
-msgstr "無法啟動 fsmonitor 健康監聽執行緒"
+msgstr "無法啟動 fsmonitor 健康檢查執行緒"
#: builtin/fsmonitor--daemon.c
msgid "could not initialize listener thread"
@@ -8077,7 +8091,7 @@ msgstr "無法初始化監聽執行緒"
#: builtin/fsmonitor--daemon.c
msgid "could not initialize health thread"
-msgstr "無法初始化健康監聽執行緒"
+msgstr "無法初始化健康檢查執行緒"
#: builtin/fsmonitor--daemon.c
#, c-format
@@ -8251,7 +8265,7 @@ msgstr "不允許 --no-schedule"
#: builtin/gc.c
#, c-format
msgid "unrecognized --schedule argument '%s'"
-msgstr "無法識別的 --schedule 引數 '%s'"
+msgstr "不認識的 --schedule 引數 '%s'"
#: builtin/gc.c
msgid "failed to write commit-graph"
@@ -8425,7 +8439,7 @@ msgstr "無法執行 systemctl"
#: builtin/gc.c
#, c-format
msgid "unrecognized --scheduler argument '%s'"
-msgstr "無法識別的 --scheduler 引數 '%s'"
+msgstr "不認識的 --scheduler 引數 '%s'"
#: builtin/gc.c
msgid "neither systemd timers nor crontab are available"
@@ -8437,8 +8451,26 @@ msgid "%s scheduler is not available"
msgstr "無法使用 %s 排程器"
#: builtin/gc.c
-msgid "another process is scheduling background maintenance"
-msgstr "其他處理程序正在排定背景維護工作"
+#, c-format
+msgid ""
+"unable to create '%s.lock': %s.\n"
+"\n"
+"Another scheduled git-maintenance(1) process seems to be running in this\n"
+"repository. Please make sure no other maintenance processes are running and\n"
+"then try again. If it still fails, a git-maintenance(1) process may have\n"
+"crashed in this repository earlier: remove the file manually to continue."
+msgstr ""
+"無法建立「%s.lock」:%s。\n"
+"\n"
+"似乎有另一個排定的 git-maintenance(1) 程序正在此\n"
+"版本庫中執行。請確保沒有其他維護程序正在執行,\n"
+"然後再試一次。如果仍然失敗,可能是先前的\n"
+"git-maintenance(1) 程序在這個版本庫中意外中斷:\n"
+"請手動移除檔案以繼續。"
+
+#: builtin/gc.c
+msgid "cannot acquire lock for scheduled background maintenance"
+msgstr "無法取得用來進行排定背景維護的鎖"
#: builtin/gc.c
msgid "git maintenance start [--scheduler=<scheduler>]"
@@ -8727,7 +8759,7 @@ msgstr "--open-files-in-pager 僅用於工作區"
#: builtin/grep.c
msgid "--[no-]exclude-standard cannot be used for tracked contents"
-msgstr "--[no-]exclude-standard 不能用於已追蹤內容"
+msgstr "--[no-]exclude-standard 無法用於已追蹤內容"
#: builtin/grep.c
msgid "both --cached and trees are given"
@@ -8825,7 +8857,7 @@ msgstr "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
#: builtin/help.c
#, c-format
msgid "unrecognized help format '%s'"
-msgstr "無法識別的協助格式 '%s'"
+msgstr "不認識的協助格式 '%s'"
#: builtin/help.c
msgid "Failed to start emacsclient."
@@ -9158,6 +9190,22 @@ msgid_plural "chain length = %d: %lu objects"
msgstr[0] "鏈長 = %d: %lu 物件"
#: builtin/index-pack.c
+msgid "could not start pack-objects to repack local links"
+msgstr "無法啟動 pack-objects 來重新打包本機連結"
+
+#: builtin/index-pack.c
+msgid "failed to feed local object to pack-objects"
+msgstr "無法將本機物件喂給 pack-objects"
+
+#: builtin/index-pack.c
+msgid "index-pack: Expecting full hex object ID lines only from pack-objects."
+msgstr "index-pack:只預期接受來自 pack-objects 的完整十六進位物件 ID。"
+
+#: builtin/index-pack.c
+msgid "could not finish pack-objects to repack local links"
+msgstr "無法結束 pack-objects 來重新封包"
+
+#: builtin/index-pack.c
msgid "Cannot come back to cwd"
msgstr "無法返回目前工作目錄"
@@ -9172,6 +9220,10 @@ msgid "unknown hash algorithm '%s'"
msgstr "未知的「%s」雜湊算法"
#: builtin/index-pack.c
+msgid "--promisor cannot be used with a pack name"
+msgstr "--promisor 不能與封包名稱一起使用"
+
+#: builtin/index-pack.c
msgid "--stdin requires a git repository"
msgstr "--stdin 需要一個 git 版本庫"
@@ -9256,7 +9308,7 @@ msgstr ""
#: builtin/interpret-trailers.c wrapper.c
#, c-format
msgid "could not stat %s"
-msgstr "不能對 %s 呼叫 stat"
+msgstr "無法 stat %s"
#: builtin/interpret-trailers.c
#, c-format
@@ -9270,21 +9322,21 @@ msgstr "檔案 %s 使用者不可寫"
#: builtin/interpret-trailers.c
msgid "could not open temporary file"
-msgstr "不能開啟暫存檔"
+msgstr "無法開啟暫存檔"
#: builtin/interpret-trailers.c
#, c-format
msgid "could not read input file '%s'"
-msgstr "不能讀取輸入檔案 '%s'"
+msgstr "無法讀取輸入檔案「%s」"
#: builtin/interpret-trailers.c builtin/mktag.c imap-send.c
msgid "could not read from stdin"
-msgstr "不能自標準輸入讀取"
+msgstr "無法從標準輸入讀取"
#: builtin/interpret-trailers.c
#, c-format
msgid "could not rename temporary file to %s"
-msgstr "不能重新命名暫存檔為 %s"
+msgstr "無法將暫存檔重新命名為 %s"
#: builtin/interpret-trailers.c
msgid "edit files in place"
@@ -9388,7 +9440,7 @@ msgstr "追蹤 <開始>,<結束> 範圍中橫列或 <檔案> 中> :<函數名稱
#: builtin/log.c builtin/replay.c builtin/shortlog.c bundle.c
#, c-format
msgid "unrecognized argument: %s"
-msgstr "無法識別的引數:%s"
+msgstr "不認識的引數:%s"
#: builtin/log.c
msgid "-L<range>:<file> cannot be used with pathspec"
@@ -9407,7 +9459,7 @@ msgstr "git show %s: 損壞的檔案"
#: builtin/log.c
#, c-format
msgid "could not read object %s"
-msgstr "不能讀取物件 %s"
+msgstr "無法讀取物件 %s"
#: builtin/log.c
#, c-format
@@ -9474,7 +9526,7 @@ msgstr "無法將 '%s' 解析為一個有效引用"
#: builtin/log.c
msgid "could not find exact merge base"
-msgstr "不能找到準確的合併基礎"
+msgstr "找不到準確的合併基礎"
#: builtin/log.c
msgid ""
@@ -9727,7 +9779,7 @@ msgstr "--remerge-diff 無意義"
#: builtin/log.c builtin/submodule--helper.c rerere.c submodule.c
#, c-format
msgid "could not create directory '%s'"
-msgstr "不能建立目錄 '%s'"
+msgstr "無法建立「%s」目錄"
#: builtin/log.c
msgid "--interdiff requires --cover-letter or single patch"
@@ -9776,7 +9828,7 @@ msgstr "git cherry [-v] [<上游> [<頭> [<限制>]]]"
#, c-format
msgid ""
"Could not find a tracked remote branch, please specify <upstream> manually.\n"
-msgstr "不能找到追蹤的遠端分支,請手動指定 <上游>。\n"
+msgstr "無法找到追蹤的遠端分支,請手動指定 <上游>。\n"
#: builtin/ls-files.c builtin/ls-tree.c
#, c-format
@@ -9900,7 +9952,7 @@ msgid ""
"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
"--eol"
msgstr ""
-"--format 不能和 -s、-o、-k、-t、--resolve-undo、--deduplicate、--eol 一起使用"
+"--format 無法和 -s、-o、-k、-t、--resolve-undo、--deduplicate、--eol 一起使用"
#: builtin/ls-remote.c
msgid ""
@@ -10162,7 +10214,7 @@ msgstr "未知選項 %s"
#: builtin/merge-recursive.c
#, c-format
msgid "could not parse object '%s'"
-msgstr "不能解析物件 '%s'"
+msgstr "無法解析物件「%s」"
#: builtin/merge-recursive.c
#, c-format
@@ -10177,7 +10229,7 @@ msgstr "不能處理兩個頭合併之外的任何動作。"
#: builtin/merge-recursive.c
#, c-format
msgid "could not resolve ref '%s'"
-msgstr "無法解析引用 '%s'"
+msgstr "無法解析引用「%s」"
#: builtin/merge-recursive.c
#, c-format
@@ -10280,7 +10332,7 @@ msgstr "選項 `%s' 需要一個值"
#: builtin/merge.c
#, c-format
msgid "Could not find merge strategy '%s'.\n"
-msgstr "不能找到合併策略 '%s'。\n"
+msgstr "找不到合併策略「%s」。\n"
#: builtin/merge.c
#, c-format
@@ -10368,7 +10420,7 @@ msgstr "繞過 pre-merge-commit 和 commit-msg 掛鉤"
#: builtin/merge.c
msgid "could not run stash."
-msgstr "不能執行貯存。"
+msgstr "無法執行貯存。"
#: builtin/merge.c
msgid "stash failed"
@@ -10428,7 +10480,7 @@ msgstr "不能寫 %s"
#: builtin/merge.c
#, c-format
msgid "Could not read from '%s'"
-msgstr "不能從 '%s' 讀取"
+msgstr "無法從「%s」進行讀取"
#: builtin/merge.c
#, c-format
@@ -10495,7 +10547,7 @@ msgstr "環境 '%2$s' 中存在壞的取值 '%1$s'"
#: builtin/merge.c editor.c read-cache.c wrapper.c
#, c-format
msgid "could not close '%s'"
-msgstr "不能關閉 '%s'"
+msgstr "無法關閉「%s」"
#: builtin/merge.c
#, c-format
@@ -10885,11 +10937,11 @@ msgstr "git notes [--ref <註解引用>] [list [<物件>]]"
msgid ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
@@ -10899,11 +10951,11 @@ msgstr "git notes [--ref <註解引用>] copy [-f] <來源物件> <目標物件>
msgid ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
msgstr ""
"git notes [--ref <notes-ref>] append [--allow-empty] [--[no-]separator|--"
"separator=<paragraph-break>] [--[no-]stripspace] [-m <msg> | -F <file> | (-c "
-"| -C) <object>] [<object>]"
+"| -C) <object>] [<object>] [-e]"
#: builtin/notes.c
msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
@@ -10984,7 +11036,7 @@ msgstr "為下面的物件寫/編輯說明:"
#: builtin/notes.c
msgid "could not read 'show' output"
-msgstr "不能讀取 'show' 的輸出"
+msgstr "無法讀取「show」的輸出"
#: builtin/notes.c
#, c-format
@@ -11007,7 +11059,7 @@ msgstr "註解內容被留在 %s 中"
#: builtin/notes.c builtin/tag.c
#, c-format
msgid "could not open or read '%s'"
-msgstr "不能開啟或讀取 '%s'"
+msgstr "無法開啟或讀取「%s」"
#: builtin/notes.c
#, c-format
@@ -11055,6 +11107,10 @@ msgid "reuse and edit specified note object"
msgstr "重用和編輯指定的註解物件"
#: builtin/notes.c
+msgid "edit note message in editor"
+msgstr "在編輯器中編輯備註訊息"
+
+#: builtin/notes.c
msgid "reuse specified note object"
msgstr "重用指定的註解物件"
@@ -11352,7 +11408,7 @@ msgstr "%s 的 delta 基準位移越界"
#: builtin/pack-objects.c
msgid "Counting objects"
-msgstr "物件計數中"
+msgstr "正在計算物件數量"
#: builtin/pack-objects.c pack-bitmap.c
#, c-format
@@ -11668,6 +11724,10 @@ msgid "do not pack objects in promisor packfiles"
msgstr "不要打包 promisor packfile 中的物件"
#: builtin/pack-objects.c
+msgid "implies --missing=allow-any"
+msgstr "隱含 --missing=allow-any"
+
+#: builtin/pack-objects.c
msgid "respect islands during delta compression"
msgstr "在差異壓縮時尊重資料島"
@@ -11696,7 +11756,7 @@ msgstr "錯誤的打包壓縮級別 %d"
#: builtin/pack-objects.c
msgid "--max-pack-size cannot be used to build a pack for transfer"
-msgstr "不能使用 --max-pack-size 來組建傳輸用的包檔案"
+msgstr "不能使用 --max-pack-size 來建構傳輸用的包檔案"
#: builtin/pack-objects.c
msgid "minimum pack size limit is 1 MiB"
@@ -12330,7 +12390,7 @@ msgstr ""
#: builtin/push.c
msgid "--all can't be combined with refspecs"
-msgstr "--all 不能和引用規格同時使用"
+msgstr "--all 無法和引用規格同時使用"
#: builtin/push.c
msgid "--mirror can't be combined with refspecs"
@@ -12492,12 +12552,12 @@ msgstr ""
#: builtin/rebase.c sequencer.c
#, c-format
msgid "could not read '%s'."
-msgstr "不能讀取 '%s'。"
+msgstr "無法讀取「%s」。"
#: builtin/rebase.c
#, c-format
msgid "could not create temporary %s"
-msgstr "無法建立暫時的 %s"
+msgstr "無法建立暫存用的 %s"
#: builtin/rebase.c
msgid "could not mark as interactive"
@@ -12505,7 +12565,7 @@ msgstr "無法標記為互動式"
#: builtin/rebase.c
msgid "could not generate todo list"
-msgstr "無法生成待辦列表"
+msgstr "無法產生待辦列表"
#: builtin/rebase.c
msgid "a base commit must be provided with --upstream or --onto"
@@ -12534,7 +12594,7 @@ msgstr "忽略無效的 allow_rerere_autoupdate:'%s'"
#: builtin/rebase.c builtin/rm.c sequencer.c
#, c-format
msgid "could not remove '%s'"
-msgstr "無法刪除 '%s'"
+msgstr "無法刪除「%s」"
#: builtin/rebase.c
#, c-format
@@ -12577,7 +12637,7 @@ msgstr "--empty=ask 已棄用。請改用「--empty=stop」。"
msgid ""
"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
"\"stop\"."
-msgstr "無法識別空類型「%s」;有效的數值有「drop」、「keep」跟「stop」。"
+msgstr "不認識空類型「%s」;有效的數值有「drop」、「keep」跟「stop」。"
#: builtin/rebase.c
msgid ""
@@ -12879,7 +12939,7 @@ msgstr "無效的上游 '%s'"
#: builtin/rebase.c
msgid "Could not create new root commit"
-msgstr "不能建立新的根提交"
+msgstr "無法建立新的根提交"
#: builtin/rebase.c
#, c-format
@@ -13235,7 +13295,7 @@ msgstr "更新 %s 中"
#: builtin/remote.c
#, c-format
msgid "Could not fetch %s"
-msgstr "不能取得 %s"
+msgstr "無法取得 %s"
#: builtin/remote.c
msgid ""
@@ -13290,7 +13350,7 @@ msgstr "遠端 %s 已經存在。"
#: builtin/remote.c
#, c-format
msgid "Could not setup master '%s'"
-msgstr "無法設定 master '%s'"
+msgstr "無法配置 master「%s」"
#: builtin/remote.c trailer.c
#, c-format
@@ -13305,7 +13365,7 @@ msgstr "branch.%s.rebase=%s 未處理。假設成 'true'"
#: builtin/remote.c
#, c-format
msgid "Could not get fetch map for refspec %s"
-msgstr "無法得到引用規格 %s 的取得列表"
+msgstr "無法取得引用規格 %s 的 fetch 映射"
#: builtin/remote.c
msgid "(matching)"
@@ -13318,12 +13378,12 @@ msgstr "(刪除)"
#: builtin/remote.c
#, c-format
msgid "could not set '%s'"
-msgstr "無法設定 '%s'"
+msgstr "無法設定「%s」"
#: builtin/remote.c config.c
#, c-format
msgid "could not unset '%s'"
-msgstr "不能取消設定 '%s'"
+msgstr "無法取消設定「%s」"
#: builtin/remote.c
#, c-format
@@ -13344,7 +13404,7 @@ msgstr "沒有此遠端版本庫:'%s'"
#: builtin/remote.c
#, c-format
msgid "Could not rename config section '%s' to '%s'"
-msgstr "不能重新命名設定小節 '%s' 到 '%s'"
+msgstr "無法將組態的「%s」區段重新命名為「%s」"
#: builtin/remote.c
#, c-format
@@ -13383,7 +13443,7 @@ msgstr[0] "注意:refs/remotes/ 層級之外的一個分支未被移除。要�
#: builtin/remote.c
#, c-format
msgid "Could not remove config section '%s'"
-msgstr "不能移除設定小節 '%s'"
+msgstr "無法移除組態的「%s」區段"
#: builtin/remote.c
#, c-format
@@ -13555,6 +13615,33 @@ msgid_plural " Local refs configured for 'git push'%s:"
msgstr[0] " 為 'git push' 設定的本機引用%s:"
#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' is unchanged and points to '%s'\n"
+msgstr "「%s/HEAD」沒有變更,指向「%s」\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' has changed from '%s' and now points to '%s'\n"
+msgstr "「%s/HEAD」已經從「%s」變更,現在指向「%s」\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' is now created and points to '%s'\n"
+msgstr "「%s/HEAD」現在已經建立並指向「%s」\n"
+
+#: builtin/remote.c
+#, c-format
+msgid "'%s/HEAD' was detached at '%s' and now points to '%s'\n"
+msgstr "「%s/HEAD」已經在「%s」處分離,現在指向「%s」\n"
+
+#: builtin/remote.c
+#, c-format
+msgid ""
+"'%s/HEAD' used to point to '%s' (which is not a remote branch), but now "
+"points to '%s'\n"
+msgstr "「%s/HEAD」原本指向「%s」(不是遠端分支),但現在指向「%s」\n"
+
+#: builtin/remote.c
msgid "set refs/remotes/<name>/HEAD according to remote"
msgstr "根據遠端設定 refs/remotes/<名稱>/HEAD"
@@ -13582,8 +13669,8 @@ msgstr "不是一個有效引用:%s"
#: builtin/remote.c
#, c-format
-msgid "Could not setup %s"
-msgstr "不能設定 %s"
+msgid "Could not set up %s"
+msgstr "無法配置 %s"
# 譯者:請維持前導空格
#: builtin/remote.c
@@ -13702,7 +13789,7 @@ msgstr "repack:期望來自 pack-objects 的完整十六進位物件 ID。"
#: builtin/repack.c
msgid "could not finish pack-objects to repack promisor objects"
-msgstr "無法完成 pack-objects 來重新打包 promisor 物件"
+msgstr "無法結束 pack-objects 來重新打包 promisor 物件"
#: builtin/repack.c
#, c-format
@@ -13722,7 +13809,7 @@ msgstr "%s 包太大,以致不能縮合"
#: builtin/repack.c
#, c-format
msgid "could not open tempfile %s for writing"
-msgstr "無法開啟 '%s' 暫存檔進行寫入"
+msgstr "無法開啟暫存檔 %s 進行寫入"
#: builtin/repack.c
msgid "could not close refs snapshot tempfile"
@@ -13986,7 +14073,7 @@ msgstr "新物件和舊物件相同:'%s'"
#: builtin/replace.c
#, c-format
msgid "could not parse %s as a commit"
-msgstr "無法將 %s 解析為一個提交"
+msgstr "無法將 %s 解析為提交"
#: builtin/replace.c
#, c-format
@@ -14017,7 +14104,7 @@ msgstr "在取代的提交中簽名將被移除!"
#: builtin/replace.c
#, c-format
msgid "could not write replacement commit for: '%s'"
-msgstr "不能為 '%s' 寫取代提交"
+msgstr "無法寫入下列項目的替代提交:「%s」"
#: builtin/replace.c
#, c-format
@@ -14035,7 +14122,7 @@ msgid ""
"could not convert the following graft(s):\n"
"%s"
msgstr ""
-"不能轉換下列移植:\n"
+"無法轉換下列移植:\n"
"%s"
#: builtin/replace.c
@@ -14072,7 +14159,7 @@ msgstr "使用此格式"
#: builtin/replace.c
msgid "--format cannot be used when not listing"
-msgstr "不列出時不能使用 --format"
+msgstr "非列出操作不能使用 --format"
#: builtin/replace.c
msgid "-f only makes sense when writing a replacement"
@@ -14338,11 +14425,11 @@ msgstr ""
#: builtin/reset.c
#, c-format
msgid "Could not reset index file to revision '%s'."
-msgstr "不能重設索引檔案至版本 '%s'。"
+msgstr "無法將索引檔案重設到修訂版「%s」。"
#: builtin/reset.c
msgid "Could not write new index file."
-msgstr "不能寫入新的索引檔案。"
+msgstr "無法寫入新的索引檔案。"
#: builtin/rev-list.c
#, c-format
@@ -15231,7 +15318,7 @@ msgstr "無法在合併過程套用貯存"
#: builtin/stash.c
#, c-format
msgid "could not generate diff %s^!."
-msgstr "無法生成差異 %s^!."
+msgstr "無法產生差異 %s^!."
#: builtin/stash.c
msgid "conflicts in index. Try without --index."
@@ -15239,7 +15326,7 @@ msgstr "索引中有衝突。請試試看不用 --index。"
#: builtin/stash.c
msgid "could not save index tree"
-msgstr "不能儲存索引樹"
+msgstr "無法儲存索引樹"
#: builtin/stash.c
#, c-format
@@ -15415,14 +15502,14 @@ msgstr "期望一個完整的引用名稱,卻得到 %s"
#: builtin/submodule--helper.c
#, c-format
msgid "could not get a repository handle for submodule '%s'"
-msgstr "無法獲得子模組 '%s' 的版本庫句柄"
+msgstr "無法取得子模組「%s」的版本庫控制代碼"
#: builtin/submodule--helper.c
#, c-format
msgid ""
"could not look up configuration '%s'. Assuming this repository is its own "
"authoritative upstream."
-msgstr "無法找到設定 '%s'。假定這個版本庫是其自身的官方上游。"
+msgstr "找不到「%s」組態設定。假定這個版本庫是其自身的官方上游。"
#: builtin/submodule--helper.c
#, c-format
@@ -15501,7 +15588,7 @@ msgstr "在 .gitmodules 中沒有發現路徑 '%s' 的子模組映射"
#: builtin/submodule--helper.c
#, c-format
msgid "could not resolve HEAD ref inside the submodule '%s'"
-msgstr "無法解析子模組 '%s' 的 HEAD 引用"
+msgstr "無法解析子模組「%s」的 HEAD 引用"
#: builtin/submodule--helper.c
#, c-format
@@ -15540,7 +15627,7 @@ msgstr "%s"
#: builtin/submodule--helper.c
#, c-format
msgid "couldn't hash object from '%s'"
-msgstr "無法雜湊來自 '%s' 的物件"
+msgstr "無法雜湊來自「%s」的物件"
#: builtin/submodule--helper.c
#, c-format
@@ -15569,7 +15656,7 @@ msgstr "git submodule summary [<options>] [<commit>] [--] [<path>]"
#: builtin/submodule--helper.c
msgid "could not fetch a revision for HEAD"
-msgstr "無法取得 HEAD 的版本"
+msgstr "無法取得 HEAD 的修訂版"
#: builtin/submodule--helper.c
#, c-format
@@ -15617,12 +15704,12 @@ msgstr "已清除目錄 '%s'\n"
#: builtin/submodule--helper.c
#, c-format
msgid "Could not remove submodule work tree '%s'\n"
-msgstr "無法移除子模組工作區 '%s'\n"
+msgstr "無法移除子模組工作區「%s」\n"
#: builtin/submodule--helper.c
#, c-format
msgid "could not create empty submodule directory %s"
-msgstr "不能建立空的子模組目錄 %s"
+msgstr "無法建立空的子模組目錄 %s"
#: builtin/submodule--helper.c
#, c-format
@@ -15662,7 +15749,7 @@ msgstr ""
#: builtin/submodule--helper.c
#, c-format
msgid "could not get a repository handle for gitdir '%s'"
-msgstr "無法取得 gitdir「%s」的版本庫控點"
+msgstr "無法取得 gitdir「%s」的版本庫控制代碼"
#: builtin/submodule--helper.c
#, c-format
@@ -15697,7 +15784,7 @@ msgstr "無法複製 '%s' 到子模組路徑 '%s'"
#: builtin/submodule--helper.c
#, c-format
msgid "could not get submodule directory for '%s'"
-msgstr "無法得到 '%s' 的子模組目錄"
+msgstr "無法取得「%s」的子模組目錄"
#: builtin/submodule--helper.c
msgid "alternative anchor for relative paths"
@@ -16826,7 +16913,7 @@ msgstr "無法取消「%2$s」中「%1$s」的設定"
#: builtin/worktree.c
#, c-format
msgid "could not create directory of '%s'"
-msgstr "不能建立目錄 '%s'"
+msgstr "無法建立「%s」的目錄"
#: builtin/worktree.c
msgid "initializing"
@@ -16917,6 +17004,10 @@ msgstr "設定追蹤模式(參見 git-branch(1))"
msgid "try to match the new branch name with a remote-tracking branch"
msgstr "嘗試為新分支名符合一個遠端追蹤分支"
+#: builtin/worktree.c
+msgid "use relative paths for worktrees"
+msgstr "對工作區使用相對路徑"
+
#: builtin/worktree.c diff.c parse-options.c
#, c-format
msgid "options '%s', '%s', and '%s' cannot be used together"
@@ -16987,7 +17078,7 @@ msgstr "'%s' 是一個主工作區"
#: builtin/worktree.c
#, c-format
msgid "could not figure out destination name from '%s'"
-msgstr "無法從 '%s' 算出目的地名稱"
+msgstr "無法從「%s」得出目的地名稱"
#: builtin/worktree.c
#, c-format
@@ -17117,7 +17208,7 @@ msgstr "無法儲存最大的建立權杖"
#: bundle-uri.c
#, c-format
msgid "unrecognized bundle mode from URI '%s'"
-msgstr "無法識別從 URI「%s」取回的套件包模式"
+msgstr "不認識從 URI「%s」取回的套件包模式"
#: bundle-uri.c
#, c-format
@@ -17158,7 +17249,7 @@ msgstr "bundle-uri: 列有空鍵或空值"
#: bundle.c
#, c-format
msgid "unrecognized bundle hash algorithm: %s"
-msgstr "無法識別的套件包雜湊演算法:%s"
+msgstr "不認識的套件包雜湊演算法:%s"
#: bundle.c
#, c-format
@@ -17173,7 +17264,7 @@ msgstr "「%s」不像是一個 v2 或 v3 版本的套件包檔案"
#: bundle.c
#, c-format
msgid "unrecognized header: %s%s (%d)"
-msgstr "無法識別的標頭:%s%s (%d)"
+msgstr "不認識的標頭:%s%s (%d)"
#: bundle.c
msgid "Repository lacks these prerequisite commits:"
@@ -17251,6 +17342,30 @@ msgstr "無法建立「%s」"
msgid "index-pack died"
msgstr "index-pack 終止"
+#: cache-tree.c
+#, c-format
+msgid "directory '%s' is present in index, but not sparse"
+msgstr "「%s」目錄已經在索引裡面,但不在稀疏簽出當中。"
+
+#: cache-tree.c unpack-trees.c
+msgid "corrupted cache-tree has entries not present in index"
+msgstr "損壞的快取樹有不在索引中的項目"
+
+#: cache-tree.c
+#, c-format
+msgid "%s with flags 0x%x should not be in cache-tree"
+msgstr "有 0x%2$x 標記的 %1$s 不應該在快取樹當中"
+
+#: cache-tree.c
+#, c-format
+msgid "bad subtree '%.*s'"
+msgstr "「%.*s」子樹損壞"
+
+#: cache-tree.c
+#, c-format
+msgid "cache-tree for path %.*s does not match. Expected %s got %s"
+msgstr "%.*s 路徑的快取樹不符。預期是 %s,卻得到 %s"
+
#: chunk-format.c
msgid "terminating chunk id appears earlier than expected"
msgstr "終止區塊 ID 比預期還早出現"
@@ -18339,7 +18454,7 @@ msgstr "正在驗證提交圖中的提交"
#: commit-reach.c sequencer.c
#, c-format
msgid "could not parse commit %s"
-msgstr "不能解析提交 %s"
+msgstr "無法解析提交 %s"
#: commit.c
#, c-format
@@ -18355,7 +18470,7 @@ msgid ""
"to convert the grafts into replace refs.\n"
"\n"
"Turn this message off by running\n"
-"\"git config advice.graftFileDeprecated false\""
+"\"git config set advice.graftFileDeprecated false\""
msgstr ""
"對 <GIT_DIR>/info/grafts 的支援已棄用,並將在\n"
"未來的 Git 版本中被移除。\n"
@@ -18363,8 +18478,8 @@ msgstr ""
"請使用「git replace --convert-graft-file」將\n"
"grafts 轉換為取代引用。\n"
"\n"
-"設定「git config advice.graftFileDeprecated false」\n"
-"可以將本訊息關閉"
+"設定「git config set advice.graftFileDeprecated false」\n"
+"可以關閉此訊息"
#: commit.c
#, c-format
@@ -18672,7 +18787,7 @@ msgstr ""
#: config.c
#, c-format
msgid "could not expand include path '%s'"
-msgstr "無法展開包含路徑 '%s'"
+msgstr "無法展開包含路徑「%s」"
#: config.c
msgid "relative config includes must come from files"
@@ -18971,7 +19086,7 @@ msgstr "不允許多列備註:「%s」"
#: config.c
#, c-format
msgid "could not lock config file %s"
-msgstr "不能鎖定設定檔案 %s"
+msgstr "無法鎖定組態檔案 %s"
#: config.c
#, c-format
@@ -19001,12 +19116,12 @@ msgstr "對 %s 呼叫 chmod 失敗"
#: config.c
#, c-format
msgid "could not write config file %s"
-msgstr "不能寫入設定檔案 %s"
+msgstr "無法寫入組態檔案 %s"
#: config.c
#, c-format
msgid "could not set '%s' to '%s'"
-msgstr "不能設定 '%s' 為 '%s'"
+msgstr "無法將「%s」設為「%s」"
#: config.c
#, c-format
@@ -19205,7 +19320,7 @@ msgstr "無法 fork"
#: connected.c
msgid "Could not run 'git rev-list'"
-msgstr "不能執行 'git rev-list'"
+msgstr "無法執行「git rev-list」"
#: connected.c
msgid "failed write to rev-list"
@@ -19362,6 +19477,21 @@ msgstr "URL 沒有 Scheme:%s"
msgid "credential url cannot be parsed: %s"
msgstr "無法解析憑證 URL:%s"
+#: daemon.c
+#, c-format
+msgid "invalid timeout '%s', expecting a non-negative integer"
+msgstr "無效的 timeout「%s」,預期為非負整數"
+
+#: daemon.c
+#, c-format
+msgid "invalid init-timeout '%s', expecting a non-negative integer"
+msgstr "無效的 init-timeout「%s」,應為非負整數"
+
+#: daemon.c
+#, c-format
+msgid "invalid max-connections '%s', expecting an integer"
+msgstr "無效的 max-connections「%s」,應為整數"
+
#: date.c
msgid "in the future"
msgstr "在將來"
@@ -19458,7 +19588,7 @@ msgstr "無法封存不存在的路徑「%s」"
#: diagnose.c dir.c
#, c-format
msgid "could not open directory '%s'"
-msgstr "不能開啟目錄 '%s'"
+msgstr "無法開啟目錄「%s」"
#: diagnose.c
#, c-format
@@ -20133,12 +20263,12 @@ msgstr "路徑規格 '%s' 未符合任何 git 已知檔案"
#: dir.c
#, c-format
msgid "unrecognized pattern: '%s'"
-msgstr "無法識別樣式:「%s」"
+msgstr "不認識樣式:「%s」"
#: dir.c
#, c-format
msgid "unrecognized negative pattern: '%s'"
-msgstr "無法識別反向模式:「%s」"
+msgstr "不認識反向模式:「%s」"
#: dir.c
#, c-format
@@ -20178,12 +20308,12 @@ msgstr "版本庫 %s 中的索引檔案損壞"
#: dir.c
#, c-format
msgid "could not create directories for %s"
-msgstr "不能為 %s 建立目錄"
+msgstr "無法建立 %s 的目錄"
#: dir.c
#, c-format
msgid "could not migrate git directory from '%s' to '%s'"
-msgstr "不能從 '%s' 遷移 git 目錄到 '%s'"
+msgstr "無法從「%s」遷移 git 目錄到「%s」"
#: editor.c
#, c-format
@@ -20193,12 +20323,12 @@ msgstr "提示:等待您的編輯器關閉檔案...%c"
#: editor.c sequencer.c wrapper.c
#, c-format
msgid "could not write to '%s'"
-msgstr "不能寫入 '%s'"
+msgstr "無法寫入「%s」"
#: editor.c
#, c-format
msgid "could not edit '%s'"
-msgstr "無法編輯 '%s'"
+msgstr "無法編輯「%s」"
#: entry.c
msgid "Filtering content"
@@ -20207,7 +20337,7 @@ msgstr "過濾內容"
#: entry.c
#, c-format
msgid "could not stat file '%s'"
-msgstr "不能對檔案 '%s' 呼叫 stat"
+msgstr "無法 stat 檔案「%s」"
#: environment.c
#, c-format
@@ -20220,6 +20350,23 @@ msgid "too many args to run %s"
msgstr "執行 %s 的參數太多"
#: fetch-pack.c
+#, c-format
+msgid ""
+"You are attempting to fetch %s, which is in the commit graph file but not in "
+"the object database.\n"
+"This is probably due to repo corruption.\n"
+"If you are attempting to repair this repo corruption by refetching the "
+"missing object, use 'git fetch --refetch' with the missing object."
+msgstr ""
+"你正在嘗試取得 %s。這個物件在提交圖檔案中,\n"
+"但不在物件資料庫中。\n"
+"\n"
+"這可能是由於儲存庫損壞所致。\n"
+"\n"
+"如果你想透過重新擷取遺失的物件來修復儲存庫損壞,\n"
+"請使用「git fetch --refetch」並指定遺失的物件。"
+
+#: fetch-pack.c
msgid "git fetch-pack: expected shallow list"
msgstr "git fetch-pack:應為 shallow 列表"
@@ -20647,7 +20794,7 @@ msgstr "執行指令 '%s' 失敗:%s\n"
#: gpg-interface.c
msgid "could not create temporary file"
-msgstr "不能建立暫存檔"
+msgstr "無法建立暫存檔"
#: gpg-interface.c
#, c-format
@@ -20925,10 +21072,10 @@ msgstr[0] ""
#, 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`."
+"You can disable this warning with `git config set advice.ignoredHook false`."
msgstr ""
-"因為沒有將掛鉤 '%s' 設定為可執行,掛鉤被忽略。您可以透過\n"
-"設定 `git config advice.ignoredHook false` 來關閉這條警告。"
+"因為沒有將掛鉤「%s」設定為可執行,因此忽略這個掛鉤。\n"
+"您可以透過設定「git config set advice.ignoredHook false」來關閉這則警告。"
#: http-fetch.c
msgid "not a git repository"
@@ -20949,18 +21096,10 @@ msgid "Delegation control is not supported with cURL < 7.22.0"
msgstr "不支援委託控制,因為 cURL < 7.22.0"
#: http.c
-msgid "Public key pinning not supported with cURL < 7.39.0"
-msgstr "不支援公鑰檔案鎖定,因為 cURL < 7.39.0"
-
-#: http.c
msgid "Unknown value for http.proactiveauth"
msgstr "http.proactiveauth 的值未知"
#: http.c
-msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
-msgstr "不支援 CURLSSLOPT_NO_REVOKE,因為 cURL < 7.44.0"
-
-#: http.c
#, c-format
msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
msgstr "不支援的 SSL 後端 '%s'。支援的 SSL 後端:"
@@ -20968,12 +21107,12 @@ msgstr "不支援的 SSL 後端 '%s'。支援的 SSL 後端:"
#: http.c
#, c-format
msgid "Could not set SSL backend to '%s': cURL was built without SSL backends"
-msgstr "無法將 SSL 後端設定為 '%s':組建 cURL 時未加入 SSL 後端"
+msgstr "無法將 SSL 後端設定為「%s」:組建 cURL 時未加入 SSL 後端"
#: http.c
#, c-format
msgid "Could not set SSL backend to '%s': already set"
-msgstr "無法將 SSL 後端設定為 '%s':已經設定"
+msgstr "無法將 SSL 後端設定為「%s」:已經設定"
#: http.c
msgid "refusing to read cookies from http.cookiefile '-'"
@@ -21089,7 +21228,7 @@ msgstr "不能混用多種過濾規格"
#: list-objects-filter-options.c
msgid "unable to upgrade repository format to support partial clone"
-msgstr "無法升級版本庫格式,以致不支援部分複製"
+msgstr "無法升級版本庫格式,以支援部分複製"
#: list-objects-filter-options.h
msgid "args"
@@ -21180,6 +21319,11 @@ msgstr "偵測到由可列印字元 (quoted) 所組成的 CRLF"
msgid "unable to format message: %s"
msgstr "無法格式化訊息:%s"
+#: merge-ll.c
+#, c-format
+msgid "invalid marker-size '%s', expecting an integer"
+msgstr "無效的 marker-size「%s」,應為整數"
+
#: merge-ort.c merge-recursive.c
#, c-format
msgid "Failed to merge submodule %s (not checked out)"
@@ -21751,7 +21895,7 @@ msgstr "合併未返回提交"
#: merge-recursive.c
#, c-format
msgid "Could not parse object '%s'"
-msgstr "不能解析物件 '%s'"
+msgstr "無法解析物件「%s」"
#: merge.c
msgid "failed to read the cache"
@@ -21871,7 +22015,7 @@ msgstr "無法將一個增量多封裝索引的套件設為過期"
#: midx-write.c
msgid "Counting referenced objects"
-msgstr "正在計算引用物件"
+msgstr "正在計算引用物件數量"
#: midx-write.c
msgid "Finding and deleting unreferenced packfiles"
@@ -21883,11 +22027,11 @@ msgstr "無法重新封裝增量的多封裝索引"
#: midx-write.c
msgid "could not start pack-objects"
-msgstr "不能開始 pack-objects"
+msgstr "無法啟動 pack-objects"
#: midx-write.c
msgid "could not finish pack-objects"
-msgstr "不能結束 pack-objects"
+msgstr "無法結束 pack-objects"
#: midx.c
msgid "multi-pack-index OID fanout is of the wrong size"
@@ -22489,17 +22633,17 @@ msgid ""
"\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\""
+"running \"git config set advice.objectNameWarning false\""
msgstr ""
-"Git 通常不會建立以 40 個十六進位字元結尾的引用,\n"
-"因為當您只提供 40 個十六進位字元時,其將被忽略。\n"
-"這些引用可能被意外建立。例如:\n"
+"Git 通常不會建立以 40 個十六進位字元結尾的參照,\n"
+"因為在指定 40 個十六進位字元時會被忽略。\n"
+"這些參照可能是意外建立的。例如,\n"
"\n"
" git switch -c $br $(git rev-parse ...)\n"
"\n"
-"當「$br」因為某些原因空白時,會建立出 40 位十六進位的引用。\n"
-"請檢查這些引用,並視需要刪除。執行\n"
-"「git config advice.objectNameWarning false」命令以關閉本訊息通知"
+"其中「$br」不知何故為空白,導致建立了一個 40 個\n"
+"十六進位字元的參照。請檢查這些參照,必要時刪除它們。\n"
+"若要關閉此訊息,請執行「git config set advice.objectNameWarning false」"
#: object-name.c
#, c-format
@@ -22693,15 +22837,6 @@ msgstr "多包位圖缺少需要的反向索引"
msgid "could not open pack %s"
msgstr "無法開啟封包 %s"
-#: pack-bitmap.c t/helper/test-read-midx.c
-msgid "could not determine MIDX preferred pack"
-msgstr "無法確定 MIDX 偏好的封裝"
-
-#: pack-bitmap.c
-#, c-format
-msgid "preferred pack (%s) is invalid"
-msgstr "偏好的封包 (%s) 無效"
-
#: pack-bitmap.c
msgid "corrupt bitmap lookup table: triplet position out of index"
msgstr "位圖查詢表損壞:三元組位置超出索引"
@@ -22774,7 +22909,7 @@ msgstr "偽合併索引超出範圍(%<PRIu32> >= %<PRIuMAX>)"
#: pack-bitmap.c
#, c-format
msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
-msgstr "在「%2$s」封包,位移 %3$<PRIuMAX> 的地方找不到「%1$s」"
+msgstr "無法在「%2$s」封包,位移 %3$<PRIuMAX> 的地方找到「%1$s」"
#: pack-bitmap.c
#, c-format
@@ -23071,7 +23206,7 @@ msgstr "解析 %s 失敗"
#: path.c
#, c-format
msgid "Could not make %s writable by group"
-msgstr "不能設定 %s 為組可寫"
+msgstr "無法設定 %s 為群組可寫"
#: pathspec.c
msgid "Escape character '\\' not allowed as last character in attr value"
@@ -23325,16 +23460,16 @@ msgstr "無法讀取提交 %s 的延伸偽合併表"
#: range-diff.c
msgid "could not start `log`"
-msgstr "不能啟動 `log`"
+msgstr "無法啟動「log」"
#: range-diff.c
msgid "could not read `log` output"
-msgstr "不能讀取 `log` 的輸出"
+msgstr "無法讀取「log」的輸出"
#: range-diff.c sequencer.c
#, c-format
msgid "could not parse commit '%s'"
-msgstr "不能解析提交 '%s'"
+msgstr "無法解析提交「%s」"
#: range-diff.c
#, c-format
@@ -23346,7 +23481,7 @@ msgstr "無法解析第一行「log」輸出:開頭不是「commit」:「%s�
#: range-diff.c
#, c-format
msgid "could not parse git header '%.*s'"
-msgstr "無法解析 git 頭 '%.*s'"
+msgstr "無法解析 git 標頭「%.*s」"
#: range-diff.c
msgid "failed to generate diff"
@@ -23355,7 +23490,7 @@ msgstr "生成 diff 失敗"
#: range-diff.c
#, c-format
msgid "could not parse log for '%s'"
-msgstr "不能解析 '%s' 的日誌"
+msgstr "無法解析「%s」的日誌"
#: reachable.c
#, c-format
@@ -23509,7 +23644,7 @@ msgstr "無法加入 load_index_extensions 執行緒:%s"
#: read-cache.c
#, c-format
msgid "could not freshen shared index '%s'"
-msgstr "無法重新整理共享索引 '%s'"
+msgstr "無法更新共享索引「%s」"
#: read-cache.c
#, c-format
@@ -23567,7 +23702,7 @@ msgstr ""
#, c-format
msgid ""
"unrecognized setting %s for option rebase.missingCommitsCheck. Ignoring."
-msgstr "選項 rebase.missingCommitsCheck 的值 %s 無法識別。已忽略。"
+msgstr "選項 rebase.missingCommitsCheck 的值 %s 不認識。已忽略。"
#: rebase-interactive.c
msgid ""
@@ -23669,7 +23804,7 @@ msgstr ""
#: rebase-interactive.c
#, c-format
msgid "could not write '%s'."
-msgstr "不能寫入 '%s'。"
+msgstr "無法寫入「%s」。"
#: rebase-interactive.c
#, c-format
@@ -23728,7 +23863,7 @@ msgstr "%%(%.*s) 不取引數"
#: ref-filter.c
#, c-format
msgid "unrecognized %%(%.*s) argument: %s"
-msgstr "無法識別的 %%(%.*s) 引數:%s"
+msgstr "不認識的 %%(%.*s) 引數:%s"
#: ref-filter.c
#, c-format
@@ -23738,7 +23873,7 @@ msgstr "期望的格式:%%(color:<顏色>)"
#: ref-filter.c
#, c-format
msgid "unrecognized color: %%(color:%s)"
-msgstr "無法識別的顏色:%%(color:%s)"
+msgstr "不認識的顏色:%%(color:%s)"
#: ref-filter.c
#, c-format
@@ -23798,17 +23933,17 @@ msgstr "期望的格式:%%(align:<寬度>,<位置>)"
#: ref-filter.c
#, c-format
msgid "unrecognized position:%s"
-msgstr "無法識別的位置:%s"
+msgstr "不認識的位置:%s"
#: ref-filter.c
#, c-format
msgid "unrecognized width:%s"
-msgstr "無法識別的寬度:%s"
+msgstr "不認識的寬度:%s"
#: ref-filter.c
#, c-format
msgid "unrecognized %%(%s) argument: %s"
-msgstr "無法識別的 %%(%s) 參數:%s"
+msgstr "不認識的 %%(%s) 參數:%s"
#: ref-filter.c
#, c-format
@@ -23879,7 +24014,7 @@ msgstr "本命令拒絕 atom %%(%.*s)"
#: ref-filter.c
#, c-format
msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
-msgstr "--format=%.*s 不能和 --python、--shell、--tcl 一起使用"
+msgstr "--format=%.*s 無法和 --python、--shell、--tcl 一起使用"
#: ref-filter.c
msgid "failed to run 'describe'"
@@ -24037,8 +24172,19 @@ msgid "log for %s is empty"
msgstr "%s 的日誌為空"
#: refs.c
-msgid "refusing to force and skip creation of reflog"
-msgstr "拒絕強制並略過建立引用日誌"
+#, c-format
+msgid "refusing to update reflog for pseudoref '%s'"
+msgstr "拒絕更新偽引用「%s」 的 reflog"
+
+#: refs.c
+#, c-format
+msgid "refusing to update pseudoref '%s'"
+msgstr "拒絕更新偽引用「%s」"
+
+#: refs.c
+#, c-format
+msgid "refusing to update reflog with bad name '%s'"
+msgstr "拒絕更新有錯誤名稱「%s」的 reflog"
#: refs.c
#, c-format
@@ -24046,9 +24192,8 @@ msgid "refusing to update ref with bad name '%s'"
msgstr "拒絕更新有錯誤名稱 '%s' 的引用"
#: refs.c
-#, c-format
-msgid "refusing to update pseudoref '%s'"
-msgstr "拒絕更新偽引用「%s」"
+msgid "refusing to force and skip creation of reflog"
+msgstr "拒絕強制並略過建立引用日誌"
#: refs.c
#, c-format
@@ -24111,6 +24256,11 @@ msgstr "無法鎖定引用「%s」:預期是指向「%s」的符號引用,�
#: refs/files-backend.c
#, c-format
+msgid "cannot read ref file '%s'"
+msgstr "無法寫入參照檔案「%s」"
+
+#: refs/files-backend.c
+#, c-format
msgid "cannot open directory %s"
msgstr "無法開啟 %s 目錄"
@@ -24367,8 +24517,13 @@ msgstr "提供了一個以上的 uploadpack,使用第一個"
#: remote.c
#, c-format
+msgid "unrecognized followRemoteHEAD value '%s' ignored"
+msgstr "已經忽略不認識的「%s」數值"
+
+#: remote.c
+#, c-format
msgid "unrecognized value transfer.credentialsInUrl: '%s'"
-msgstr "數值 transfer.credentialsInUrl 無法識別:「%s」"
+msgstr "數值 transfer.credentialsInUrl 不認識:「%s」"
#: remote.c
#, c-format
@@ -24657,7 +24812,7 @@ msgstr "寫入 '%s' (%s) 時發生錯誤"
#: rerere.c
#, c-format
msgid "could not parse conflict hunks in '%s'"
-msgstr "不能解析 '%s' 中的衝突區塊"
+msgstr "無法解析「%s」中的衝突區塊"
#: rerere.c
#, c-format
@@ -24724,7 +24879,7 @@ msgstr "如果可能,重用衝突解決更新索引"
#: reset.c
msgid "could not determine HEAD revision"
-msgstr "不能確定 HEAD 版本"
+msgstr "無法確定 HEAD 修訂版"
#: reset.c sequencer.c
#, c-format
@@ -25110,7 +25265,7 @@ msgstr "無效的提交說明清理模式 '%s'"
#: sequencer.c
#, c-format
msgid "could not delete '%s'"
-msgstr "無法刪除 '%s'"
+msgstr "無法刪除「%s」"
#: sequencer.c
msgid "revert"
@@ -25185,12 +25340,12 @@ msgstr ""
#: sequencer.c
#, c-format
msgid "could not lock '%s'"
-msgstr "不能鎖定 '%s'"
+msgstr "無法鎖定「%s」"
#: sequencer.c
#, c-format
msgid "could not write eol to '%s'"
-msgstr "不能將換行符號寫入 '%s'"
+msgstr "無法將換行符號寫入「%s」"
#: sequencer.c
#, c-format
@@ -25220,7 +25375,7 @@ msgstr "不能更新快取樹"
#: sequencer.c
msgid "could not resolve HEAD commit"
-msgstr "不能解析 HEAD 提交"
+msgstr "無法解析 HEAD 提交"
#: sequencer.c
#, c-format
@@ -25347,7 +25502,7 @@ msgstr "無法找到新建立的提交"
#: sequencer.c
msgid "could not parse newly created commit"
-msgstr "不能解析新建立的提交"
+msgstr "無法解析新建立的提交"
#: sequencer.c
msgid "unable to resolve HEAD after creating commit"
@@ -25364,7 +25519,7 @@ msgstr " (根提交)"
#: sequencer.c
msgid "could not parse HEAD"
-msgstr "不能解析 HEAD"
+msgstr "無法解析 HEAD"
#: sequencer.c
#, c-format
@@ -25392,12 +25547,12 @@ msgstr "作者資訊損壞:缺少日期資訊"
#: sequencer.c
#, c-format
msgid "could not update %s"
-msgstr "不能更新 %s"
+msgstr "無法更新 %s"
#: sequencer.c
#, c-format
msgid "could not parse parent commit %s"
-msgstr "不能解析父提交 %s"
+msgstr "無法解析父提交 %s"
#: sequencer.c
#, c-format
@@ -25438,16 +25593,16 @@ msgstr "需要一個 HEAD 來修復"
#: sequencer.c
msgid "could not read HEAD"
-msgstr "不能讀取 HEAD"
+msgstr "無法讀取 HEAD"
#: sequencer.c
msgid "could not read HEAD's commit message"
-msgstr "不能讀取 HEAD 的提交說明"
+msgstr "無法讀取 HEAD 的提交說明"
#: sequencer.c
#, c-format
msgid "could not read commit message of %s"
-msgstr "不能讀取 %s 的提交說明"
+msgstr "無法讀取 %s 的提交說明"
#: sequencer.c
msgid "your index file is unmerged."
@@ -25482,12 +25637,12 @@ msgstr "%s:不能解析父提交 %s"
#: sequencer.c
#, c-format
msgid "could not revert %s... %s"
-msgstr "不能還原 %s... %s"
+msgstr "無法還原 %s... %s"
#: sequencer.c
#, c-format
msgid "could not apply %s... %s"
-msgstr "不能套用 %s... %s"
+msgstr "無法套用 %s... %s"
#: sequencer.c
#, c-format
@@ -25580,7 +25735,7 @@ msgstr "缺少 %s 的參數"
#: sequencer.c
#, c-format
msgid "could not parse '%s'"
-msgstr "無法解析 '%s'"
+msgstr "無法解析「%s」"
#: sequencer.c
#, c-format
@@ -25655,7 +25810,7 @@ msgstr "嘗試 \"git cherry-pick (--continue | %s--abort | --quit)\""
#: sequencer.c
#, c-format
msgid "could not create sequencer directory '%s'"
-msgstr "不能建立序列目錄 '%s'"
+msgstr "無法建立序列目錄「%s」"
#: sequencer.c
msgid "no cherry-pick or revert in progress"
@@ -25742,12 +25897,12 @@ msgstr ""
#: sequencer.c
#, c-format
msgid "Could not apply %s... %.*s"
-msgstr "不能套用 %s... %.*s"
+msgstr "無法套用 %s... %.*s"
#: sequencer.c
#, c-format
msgid "Could not merge %.*s"
-msgstr "不能合併 %.*s"
+msgstr "無法合併 %.*s"
#: sequencer.c
#, c-format
@@ -25799,7 +25954,7 @@ msgstr "非法的標籤名稱:'%.*s'"
#: sequencer.c
#, c-format
msgid "could not resolve '%s'"
-msgstr "無法解析 '%s'"
+msgstr "無法解析「%s」"
#: sequencer.c
msgid "writing fake root commit"
@@ -25830,12 +25985,12 @@ msgstr "章魚合並不能在一個新的根提交上執行"
#: sequencer.c
#, c-format
msgid "could not get commit message of '%s'"
-msgstr "不能取得 '%s' 的提交說明"
+msgstr "無法取得「%s」的提交說明"
#: sequencer.c
#, c-format
msgid "could not even attempt to merge '%.*s'"
-msgstr "甚至不能嘗試合併 '%.*s'"
+msgstr "甚至無法嘗試合併「%.*s」"
#: sequencer.c
msgid "merge: Unable to write new index file"
@@ -25877,7 +26032,7 @@ msgstr "意外的 stash 回應:'%s'"
#: sequencer.c
#, c-format
msgid "Could not create directory for '%s'"
-msgstr "不能為 '%s' 建立目錄"
+msgstr "無法建立「%s」的目錄"
#: sequencer.c
#, c-format
@@ -25923,7 +26078,7 @@ msgstr "autostash 引用是符號引用"
#: sequencer.c
msgid "could not detach HEAD"
-msgstr "不能分離開頭指標"
+msgstr "無法分離開頭指標"
#: sequencer.c
#, c-format
@@ -25950,7 +26105,7 @@ msgstr ""
"無法執行待辦指令\n"
"\n"
" %.*s\n"
-"已被重新安排,在繼續之前編輯指令,請先編輯待辦列表:\n"
+"已經重新安排。若要在繼續之前編輯指令,請先編輯待辦列表:\n"
"\n"
" git rebase --edit-todo\n"
" git rebase --continue\n"
@@ -25972,16 +26127,16 @@ msgstr "未知指令 %d"
#: sequencer.c
msgid "could not read orig-head"
-msgstr "不能讀取 orig-head"
+msgstr "無法讀取 orig-head"
#: sequencer.c
msgid "could not read 'onto'"
-msgstr "不能讀取 'onto'"
+msgstr "無法讀取「onto」"
#: sequencer.c
#, c-format
msgid "could not update HEAD to %s"
-msgstr "不能更新 HEAD 為 %s"
+msgstr "無法將 HEAD 更新到 %s"
#: sequencer.c
#, c-format
@@ -26018,15 +26173,15 @@ msgstr ""
#: sequencer.c
#, c-format
msgid "could not write file: '%s'"
-msgstr "不能寫入檔案:'%s'"
+msgstr "無法寫入檔案:「%s」"
#: sequencer.c
msgid "could not remove CHERRY_PICK_HEAD"
-msgstr "不能刪除 CHERRY_PICK_HEAD"
+msgstr "無法刪除 CHERRY_PICK_HEAD"
#: sequencer.c
msgid "could not commit staged changes."
-msgstr "不能提交暫存的修改。"
+msgstr "無法提交暫存的修改。"
#: sequencer.c
#, c-format
@@ -26446,7 +26601,7 @@ msgstr "忽略可能被解析為命令列選項的 '%s':%s"
#: submodule-config.c
#, c-format
msgid "Could not update .gitmodules entry %s"
-msgstr "不能更新 .gitmodules 條目 %s"
+msgstr "無法更新 .gitmodules 條目 %s"
#: submodule.c
msgid "Cannot change unmerged .gitmodules, resolve merge conflicts first"
@@ -26498,7 +26653,7 @@ msgstr "子模組條目 '%s'(%s)是一個 %s,不是一個提交"
msgid ""
"Could not run 'git rev-list <commits> --not --remotes -n 1' command in "
"submodule %s"
-msgstr "無法在 %s 子模組執行 'git rev-list <提交> --not --remotes -n 1' 命令"
+msgstr "無法在 %s 子模組執行「git rev-list <提交> --not --remotes -n 1」命令"
#: submodule.c
#, c-format
@@ -26552,7 +26707,7 @@ msgstr "無法將 '%s' 識別為一個 git 版本庫"
#: submodule.c
#, c-format
msgid "Could not run 'git status --porcelain=2' in submodule %s"
-msgstr "無法在 %s 子模組執行 'git status --porcelain=2'"
+msgstr "無法在 %s 子模組執行「git status --porcelain=2」"
#: submodule.c
#, c-format
@@ -26562,17 +26717,17 @@ msgstr "%s 子模組執行 'git status --porcelain=2' 失敗"
#: submodule.c
#, c-format
msgid "could not start 'git status' in submodule '%s'"
-msgstr "無法在子模組 '%s' 中啟動 'git status'"
+msgstr "無法在子模組「%s」中啟動「git status」"
#: submodule.c
#, c-format
msgid "could not run 'git status' in submodule '%s'"
-msgstr "無法在子模組 '%s' 中執行 'git status'"
+msgstr "無法在子模組「%s」中執行「git status」"
#: submodule.c
#, c-format
msgid "Could not unset core.worktree setting in submodule '%s'"
-msgstr "無法在子模組 '%s' 中取消 core.worktree 的設定"
+msgstr "無法在子模組「%s」中取消 core.worktree 的設定"
#: submodule.c
#, c-format
@@ -26617,7 +26772,7 @@ msgstr "不支援對有多個工作區的子模組 '%s' 執行 relocate_gitdir"
#: submodule.c
#, c-format
msgid "could not lookup name for submodule '%s'"
-msgstr "不能查詢子模組 '%s' 的名稱"
+msgstr "無法查詢子模組「%s」的名稱"
#: submodule.c
#, c-format
@@ -26678,6 +26833,10 @@ msgstr "提交 %s 沒有標記為可以取得"
msgid "too many commits marked reachable"
msgstr "太多提交標記為可以取得"
+#: t/helper/test-read-midx.c
+msgid "could not determine MIDX preferred pack"
+msgstr "無法確定 MIDX 偏好的封裝"
+
#: t/helper/test-serve-v2.c
msgid "test-tool serve-v2 [<options>]"
msgstr "test-tool serve-v2 [<選項>]"
@@ -26833,7 +26992,7 @@ msgstr "%s 也鎖定了 %s"
#: transport-helper.c
msgid "couldn't run fast-import"
-msgstr "不能執行 fast-import"
+msgstr "無法執行 fast-import"
#: transport-helper.c
msgid "error while running fast-import"
@@ -27014,7 +27173,7 @@ msgstr "伺服器不支援「等待完成」(wait-for-done) 功能"
#: transport.c
msgid "could not parse transport.color.* config"
-msgstr "不能解析 transport.color.* 設定"
+msgstr "無法解析 transport.color.* 組態"
#: transport.c
msgid "support for protocol v2 not implemented yet"
@@ -27453,6 +27612,10 @@ msgid ".git file incorrect"
msgstr ".git 檔案不正確"
#: worktree.c
+msgid ".git file absolute/relative path mismatch"
+msgstr ".git 檔案的絕對或相對路徑不一致"
+
+#: worktree.c
msgid "not a valid path"
msgstr "非有效路徑"
@@ -27473,6 +27636,10 @@ msgid "gitdir unreadable"
msgstr "無法讀取 gitdir"
#: worktree.c
+msgid "gitdir absolute/relative path mismatch"
+msgstr "gitdir 的絕對或相對路徑不一致"
+
+#: worktree.c
msgid "gitdir incorrect"
msgstr "不正確的 gitdir"
@@ -27516,10 +27683,18 @@ msgstr "無法取消在「%2$s」設定的 %1$s"
msgid "failed to set extensions.worktreeConfig setting"
msgstr "無法設定 extensions.worktreeConfig 設定"
+#: worktree.c
+msgid "unable to upgrade repository format to support relative worktrees"
+msgstr "無法升級版本庫格式,以支援相對路徑工作區"
+
+#: worktree.c
+msgid "unable to set extensions.relativeWorktrees setting"
+msgstr "無法設定 extensions.relativeWorktrees 設定"
+
#: wrapper.c
#, c-format
msgid "could not setenv '%s'"
-msgstr "無法 setenv '%s'"
+msgstr "無法 setenv「%s」"
#: wrapper.c
#, c-format
@@ -27529,7 +27704,7 @@ msgstr "不能建立 '%s'"
#: wrapper.c
#, c-format
msgid "could not open '%s' for reading and writing"
-msgstr "無法開啟 '%s' 進行讀寫"
+msgstr "無法開啟「%s」進行讀寫"
#: wrapper.c
#, c-format
@@ -28582,6 +28757,24 @@ msgstr "略過 %s 含備份後綴 '%s'。\n"
msgid "Do you really want to send %s? [y|N]: "
msgstr "您真的要傳送 %s?[y|N]: "
+#, c-format
+#~ msgid "preferred pack (%s) is invalid"
+#~ msgstr "偏好的封包 (%s) 無效"
+
+#, c-format
+#~ msgid ""
+#~ "more than %i tags found; listed %i most recent\n"
+#~ "gave up search at %s\n"
+#~ msgstr ""
+#~ "發現多於 %i 個標籤,列出最近的 %i 個\n"
+#~ "在 %s 放棄搜尋\n"
+
+#~ msgid "Public key pinning not supported with cURL < 7.39.0"
+#~ msgstr "不支援公鑰檔案鎖定,因為 cURL < 7.39.0"
+
+#~ msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
+#~ msgstr "不支援 CURLSSLOPT_NO_REVOKE,因為 cURL < 7.44.0"
+
#~ msgid "revision walk setup failed\n"
#~ msgstr "修訂版遍歷設定失敗\n"
diff --git a/preload-index.c b/preload-index.c
index 7926eb09a6..40ab2abafb 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -3,6 +3,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "pathspec.h"
@@ -131,7 +132,9 @@ void preload_index(struct index_state *index,
memset(&pd, 0, sizeof(pd));
if (refresh_flags & REFRESH_PROGRESS && isatty(2)) {
- pd.progress = start_delayed_progress(_("Refreshing index"), index->cache_nr);
+ pd.progress = start_delayed_progress(the_repository,
+ _("Refreshing index"),
+ index->cache_nr);
pthread_mutex_init(&pd.mutex, NULL);
}
diff --git a/pretty.c b/pretty.c
index 098378720a..0bc8ad8a9a 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/prio-queue.c b/prio-queue.c
index 450775a374..ec33ac27db 100644
--- a/prio-queue.c
+++ b/prio-queue.c
@@ -1,26 +1,29 @@
#include "git-compat-util.h"
#include "prio-queue.h"
-static inline int compare(struct prio_queue *queue, int i, int j)
+static inline int compare(struct prio_queue *queue, size_t i, size_t j)
{
int cmp = queue->compare(queue->array[i].data, queue->array[j].data,
queue->cb_data);
if (!cmp)
- cmp = queue->array[i].ctr - queue->array[j].ctr;
+ cmp = (queue->array[i].ctr > queue->array[j].ctr) -
+ (queue->array[i].ctr < queue->array[j].ctr);
return cmp;
}
-static inline void swap(struct prio_queue *queue, int i, int j)
+static inline void swap(struct prio_queue *queue, size_t i, size_t j)
{
SWAP(queue->array[i], queue->array[j]);
}
void prio_queue_reverse(struct prio_queue *queue)
{
- int i, j;
+ size_t i, j;
if (queue->compare)
BUG("prio_queue_reverse() on non-LIFO queue");
+ if (!queue->nr)
+ return;
for (i = 0; i < (j = (queue->nr - 1) - i); i++)
swap(queue, i, j);
}
@@ -35,7 +38,7 @@ void clear_prio_queue(struct prio_queue *queue)
void prio_queue_put(struct prio_queue *queue, void *thing)
{
- int ix, parent;
+ size_t ix, parent;
/* Append at the end */
ALLOC_GROW(queue->array, queue->nr + 1, queue->alloc);
@@ -58,7 +61,7 @@ void prio_queue_put(struct prio_queue *queue, void *thing)
void *prio_queue_get(struct prio_queue *queue)
{
void *result;
- int ix, child;
+ size_t ix, child;
if (!queue->nr)
return NULL;
diff --git a/prio-queue.h b/prio-queue.h
index 4f9a37e6be..38d032636d 100644
--- a/prio-queue.h
+++ b/prio-queue.h
@@ -22,15 +22,15 @@
typedef int (*prio_queue_compare_fn)(const void *one, const void *two, void *cb_data);
struct prio_queue_entry {
- unsigned ctr;
+ size_t ctr;
void *data;
};
struct prio_queue {
prio_queue_compare_fn compare;
- unsigned insertion_ctr;
+ size_t insertion_ctr;
void *cb_data;
- int alloc, nr;
+ size_t alloc, nr;
struct prio_queue_entry *array;
};
diff --git a/progress.c b/progress.c
index 0d44c18edc..8d5ae70f3a 100644
--- a/progress.c
+++ b/progress.c
@@ -9,7 +9,7 @@
*/
#define GIT_TEST_PROGRESS_ONLY
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "pager.h"
@@ -36,6 +36,7 @@ struct throughput {
};
struct progress {
+ struct repository *repo;
const char *title;
uint64_t last_value;
uint64_t total;
@@ -253,10 +254,12 @@ void display_progress(struct progress *progress, uint64_t n)
display(progress, n, NULL);
}
-static struct progress *start_progress_delay(const char *title, uint64_t total,
+static struct progress *start_progress_delay(struct repository *r,
+ const char *title, uint64_t total,
unsigned delay, unsigned sparse)
{
struct progress *progress = xmalloc(sizeof(*progress));
+ progress->repo = r;
progress->title = title;
progress->total = total;
progress->last_value = -1;
@@ -269,7 +272,7 @@ static struct progress *start_progress_delay(const char *title, uint64_t total,
progress->title_len = utf8_strwidth(title);
progress->split = 0;
set_progress_signal();
- trace2_region_enter("progress", title, the_repository);
+ trace2_region_enter("progress", title, r);
return progress;
}
@@ -283,14 +286,16 @@ static int get_default_delay(void)
return delay_in_secs;
}
-struct progress *start_delayed_progress(const char *title, uint64_t total)
+struct progress *start_delayed_progress(struct repository *r,
+ const char *title, uint64_t total)
{
- return start_progress_delay(title, total, get_default_delay(), 0);
+ return start_progress_delay(r, title, total, get_default_delay(), 0);
}
-struct progress *start_progress(const char *title, uint64_t total)
+struct progress *start_progress(struct repository *r,
+ const char *title, uint64_t total)
{
- return start_progress_delay(title, total, 0, 0);
+ return start_progress_delay(r, title, total, 0, 0);
}
/*
@@ -302,15 +307,17 @@ struct progress *start_progress(const char *title, uint64_t total)
* When "sparse" is set, stop_progress() will automatically force the done
* message to show 100%.
*/
-struct progress *start_sparse_progress(const char *title, uint64_t total)
+struct progress *start_sparse_progress(struct repository *r,
+ const char *title, uint64_t total)
{
- return start_progress_delay(title, total, 0, 1);
+ return start_progress_delay(r, title, total, 0, 1);
}
-struct progress *start_delayed_sparse_progress(const char *title,
+struct progress *start_delayed_sparse_progress(struct repository *r,
+ const char *title,
uint64_t total)
{
- return start_progress_delay(title, total, get_default_delay(), 1);
+ return start_progress_delay(r, title, total, get_default_delay(), 1);
}
static void finish_if_sparse(struct progress *progress)
@@ -340,14 +347,14 @@ static void force_last_update(struct progress *progress, const char *msg)
static void log_trace2(struct progress *progress)
{
- trace2_data_intmax("progress", the_repository, "total_objects",
+ trace2_data_intmax("progress", progress->repo, "total_objects",
progress->total);
if (progress->throughput)
- trace2_data_intmax("progress", the_repository, "total_bytes",
+ trace2_data_intmax("progress", progress->repo, "total_bytes",
progress->throughput->curr_total);
- trace2_region_leave("progress", progress->title, the_repository);
+ trace2_region_leave("progress", progress->title, progress->repo);
}
void stop_progress_msg(struct progress **p_progress, const char *msg)
diff --git a/progress.h b/progress.h
index 3a945637c8..ed068c7bab 100644
--- a/progress.h
+++ b/progress.h
@@ -3,6 +3,7 @@
#include "gettext.h"
struct progress;
+struct repository;
#ifdef GIT_TEST_PROGRESS_ONLY
@@ -14,10 +15,14 @@ void progress_test_force_update(void);
void display_throughput(struct progress *progress, uint64_t total);
void display_progress(struct progress *progress, uint64_t n);
-struct progress *start_progress(const char *title, uint64_t total);
-struct progress *start_sparse_progress(const char *title, uint64_t total);
-struct progress *start_delayed_progress(const char *title, uint64_t total);
-struct progress *start_delayed_sparse_progress(const char *title,
+struct progress *start_progress(struct repository *r,
+ const char *title, uint64_t total);
+struct progress *start_sparse_progress(struct repository *r,
+ const char *title, uint64_t total);
+struct progress *start_delayed_progress(struct repository *r,
+ const char *title, uint64_t total);
+struct progress *start_delayed_sparse_progress(struct repository *r,
+ const char *title,
uint64_t total);
void stop_progress_msg(struct progress **p_progress, const char *msg);
static inline void stop_progress(struct progress **p_progress)
diff --git a/promisor-remote.c b/promisor-remote.c
index 9345ae3db2..c714f4f007 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -283,7 +283,7 @@ void promisor_remote_get_direct(struct repository *repo,
}
for (i = 0; i < remaining_nr; i++) {
- if (is_promisor_object(&remaining_oids[i]))
+ if (is_promisor_object(repo, &remaining_oids[i]))
die(_("could not fetch %s from promisor remote"),
oid_to_hex(&remaining_oids[i]));
}
diff --git a/prune-packed.c b/prune-packed.c
index 2bb99c29df..7dad2fc0c1 100644
--- a/prune-packed.c
+++ b/prune-packed.c
@@ -24,7 +24,7 @@ static int prune_object(const struct object_id *oid, const char *path,
{
int *opts = data;
- if (!has_object_pack(oid))
+ if (!has_object_pack(the_repository, oid))
return 0;
if (*opts & PRUNE_PACKED_DRY_RUN)
@@ -37,7 +37,8 @@ static int prune_object(const struct object_id *oid, const char *path,
void prune_packed_objects(int opts)
{
if (opts & PRUNE_PACKED_VERBOSE)
- progress = start_delayed_progress(_("Removing duplicate objects"), 256);
+ progress = start_delayed_progress(the_repository,
+ _("Removing duplicate objects"), 256);
for_each_loose_file_in_objdir(repo_get_object_directory(the_repository),
prune_object, NULL, prune_subdir, &opts);
diff --git a/pseudo-merge.c b/pseudo-merge.c
index bb59965ed2..893b763fe4 100644
--- a/pseudo-merge.c
+++ b/pseudo-merge.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "pseudo-merge.h"
@@ -458,7 +459,8 @@ void select_pseudo_merges(struct bitmap_writer *writer)
return;
if (writer->show_progress)
- progress = start_progress("Selecting pseudo-merge commits",
+ progress = start_progress(the_repository,
+ "Selecting pseudo-merge commits",
writer->pseudo_merge_groups.nr);
refs_for_each_ref(get_main_ref_store(the_repository),
diff --git a/quote.c b/quote.c
index 3c05194496..b9f6bdc775 100644
--- a/quote.c
+++ b/quote.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "path.h"
#include "quote.h"
diff --git a/range-diff.c b/range-diff.c
index 10885ba301..9501c358a8 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
@@ -38,7 +39,8 @@ struct patch_util {
* as struct object_id (will need to be free()d).
*/
static int read_patches(const char *range, struct string_list *list,
- const struct strvec *other_arg)
+ const struct strvec *other_arg,
+ unsigned int include_merges)
{
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;
@@ -49,7 +51,7 @@ static int read_patches(const char *range, struct string_list *list,
size_t size;
int ret = -1;
- strvec_pushl(&cp.args, "log", "--no-color", "-p", "--no-merges",
+ strvec_pushl(&cp.args, "log", "--no-color", "-p",
"--reverse", "--date-order", "--decorate=no",
"--no-prefix", "--submodule=short",
/*
@@ -64,6 +66,8 @@ static int read_patches(const char *range, struct string_list *list,
"--pretty=medium",
"--show-notes-by-default",
NULL);
+ if (!include_merges)
+ strvec_push(&cp.args, "--no-merges");
strvec_push(&cp.args, range);
if (other_arg)
strvec_pushv(&cp.args, other_arg->v);
@@ -96,11 +100,14 @@ static int read_patches(const char *range, struct string_list *list,
}
if (skip_prefix(line, "commit ", &p)) {
+ char *q;
if (util) {
string_list_append(list, buf.buf)->util = util;
strbuf_reset(&buf);
}
CALLOC_ARRAY(util, 1);
+ if (include_merges && (q = strstr(p, " (from ")))
+ *q = '\0';
if (repo_get_oid(the_repository, p, &util->oid)) {
error(_("could not parse commit '%s'"), p);
FREE_AND_NULL(util);
@@ -571,13 +578,14 @@ int show_range_diff(const char *range1, const char *range2,
struct string_list branch1 = STRING_LIST_INIT_DUP;
struct string_list branch2 = STRING_LIST_INIT_DUP;
+ unsigned int include_merges = range_diff_opts->include_merges;
if (range_diff_opts->left_only && range_diff_opts->right_only)
res = error(_("options '%s' and '%s' cannot be used together"), "--left-only", "--right-only");
- if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg))
+ if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg, include_merges))
res = error(_("could not parse log for '%s'"), range1);
- if (!res && read_patches(range2, &branch2, range_diff_opts->other_arg))
+ if (!res && read_patches(range2, &branch2, range_diff_opts->other_arg, include_merges))
res = error(_("could not parse log for '%s'"), range2);
if (!res) {
diff --git a/range-diff.h b/range-diff.h
index 2f69f6a434..cd85000b5a 100644
--- a/range-diff.h
+++ b/range-diff.h
@@ -16,6 +16,7 @@ struct range_diff_options {
int creation_factor;
unsigned dual_color:1;
unsigned left_only:1, right_only:1;
+ unsigned include_merges:1;
const struct diff_options *diffopt; /* may be NULL */
const struct strvec *other_arg; /* may be NULL */
};
diff --git a/reachable.c b/reachable.c
index 3e9b3dd0a4..ecf7ccf504 100644
--- a/reachable.c
+++ b/reachable.c
@@ -239,7 +239,7 @@ static int want_recent_object(struct recent_data *data,
const struct object_id *oid)
{
if (data->ignore_in_core_kept_packs &&
- has_object_kept_pack(oid, IN_CORE_KEEP_PACKS))
+ has_object_kept_pack(data->revs->repo, oid, IN_CORE_KEEP_PACKS))
return 0;
return 1;
}
@@ -324,7 +324,7 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
if (ignore_in_core_kept_packs)
flags |= FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS;
- r = for_each_packed_object(add_recent_packed, &data, flags);
+ r = for_each_packed_object(revs->repo, add_recent_packed, &data, flags);
done:
oidset_clear(&data.extra_recent_oids);
diff --git a/read-cache.c b/read-cache.c
index 01d0b3ad22..d54be2c172 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "bulk-checkin.h"
@@ -1522,7 +1523,8 @@ int refresh_index(struct index_state *istate, unsigned int flags,
int t2_sum_scan = 0;
if (flags & REFRESH_PROGRESS && isatty(2))
- progress = start_delayed_progress(_("Refresh index"),
+ progress = start_delayed_progress(the_repository,
+ _("Refresh index"),
istate->cache_nr);
trace_performance_enter();
@@ -1752,7 +1754,7 @@ static int read_index_extension(struct index_state *istate,
istate->cache_tree = cache_tree_read(data, sz);
break;
case CACHE_EXT_RESOLVE_UNDO:
- istate->resolve_undo = resolve_undo_read(data, sz);
+ istate->resolve_undo = resolve_undo_read(data, sz, the_hash_algo);
break;
case CACHE_EXT_LINK:
if (read_link_extension(istate, data, sz))
@@ -3031,7 +3033,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
istate->resolve_undo) {
strbuf_reset(&sb);
- resolve_undo_write(&sb, istate->resolve_undo);
+ resolve_undo_write(&sb, istate->resolve_undo, the_hash_algo);
err = write_index_ext_header(f, eoie_c, CACHE_EXT_RESOLVE_UNDO,
sb.len) < 0;
hashwrite(f, sb.buf, sb.len);
diff --git a/ref-filter.c b/ref-filter.c
index 84c6036107..6da8d4c03b 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
@@ -234,6 +235,10 @@ static struct used_atom {
enum { S_BARE, S_GRADE, S_SIGNER, S_KEY,
S_FINGERPRINT, S_PRI_KEY_FP, S_TRUST_LEVEL } option;
} signature;
+ struct {
+ char *name;
+ struct commit *commit;
+ } base;
struct strvec describe_args;
struct refname_atom refname;
char *head;
@@ -890,35 +895,30 @@ static int rest_atom_parser(struct ref_format *format UNUSED,
return 0;
}
-static int ahead_behind_atom_parser(struct ref_format *format,
- struct used_atom *atom UNUSED,
+static int ahead_behind_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
- struct string_list_item *item;
-
if (!arg)
return strbuf_addf_ret(err, -1, _("expected format: %%(ahead-behind:<committish>)"));
- item = string_list_append(&format->bases, arg);
- item->util = lookup_commit_reference_by_name(arg);
- if (!item->util)
+ atom->u.base.commit = lookup_commit_reference_by_name(arg);
+ if (!atom->u.base.commit)
die("failed to find '%s'", arg);
return 0;
}
-static int is_base_atom_parser(struct ref_format *format,
- struct used_atom *atom UNUSED,
+static int is_base_atom_parser(struct ref_format *format UNUSED,
+ struct used_atom *atom,
const char *arg, struct strbuf *err)
{
- struct string_list_item *item;
-
if (!arg)
return strbuf_addf_ret(err, -1, _("expected format: %%(is-base:<committish>)"));
- item = string_list_append(&format->is_base_tips, arg);
- item->util = lookup_commit_reference_by_name(arg);
- if (!item->util)
+ atom->u.base.name = xstrdup(arg);
+ atom->u.base.commit = lookup_commit_reference_by_name(arg);
+ if (!atom->u.base.commit)
die("failed to find '%s'", arg);
return 0;
@@ -3008,6 +3008,8 @@ void ref_array_clear(struct ref_array *array)
free(atom->u.head);
else if (atom->atom_type == ATOM_DESCRIBE)
strvec_clear(&atom->u.describe_args);
+ else if (atom->atom_type == ATOM_ISBASE)
+ free(atom->u.base.name);
else if (atom->atom_type == ATOM_TRAILERS ||
(atom->atom_type == ATOM_CONTENTS &&
atom->u.contents.option == C_TRAILERS)) {
@@ -3040,7 +3042,7 @@ static void reach_filter(struct ref_array *array,
struct commit_list **check_reachable,
int include_reached)
{
- int i, old_nr;
+ size_t i, old_nr;
struct commit **to_clear;
if (!*check_reachable)
@@ -3083,22 +3085,30 @@ static void reach_filter(struct ref_array *array,
}
void filter_ahead_behind(struct repository *r,
- struct ref_format *format,
struct ref_array *array)
{
struct commit **commits;
- size_t commits_nr = format->bases.nr + array->nr;
+ size_t bases_nr, commits_nr;
+
+ if (!array->nr)
+ return;
- if (!format->bases.nr || !array->nr)
+ for (size_t i = bases_nr = 0; i < used_atom_cnt; i++) {
+ if (used_atom[i].atom_type == ATOM_AHEADBEHIND)
+ bases_nr++;
+ }
+ if (!bases_nr)
return;
- ALLOC_ARRAY(commits, commits_nr);
- for (size_t i = 0; i < format->bases.nr; i++)
- commits[i] = format->bases.items[i].util;
+ ALLOC_ARRAY(commits, st_add(bases_nr, array->nr));
+ for (size_t i = 0, j = 0; i < used_atom_cnt; i++) {
+ if (used_atom[i].atom_type == ATOM_AHEADBEHIND)
+ commits[j++] = used_atom[i].u.base.commit;
+ }
- ALLOC_ARRAY(array->counts, st_mult(format->bases.nr, array->nr));
+ ALLOC_ARRAY(array->counts, st_mult(bases_nr, array->nr));
- commits_nr = format->bases.nr;
+ commits_nr = bases_nr;
array->counts_nr = 0;
for (size_t i = 0; i < array->nr; i++) {
const char *name = array->items[i]->refname;
@@ -3107,8 +3117,8 @@ void filter_ahead_behind(struct repository *r,
if (!commits[commits_nr])
continue;
- CALLOC_ARRAY(array->items[i]->counts, format->bases.nr);
- for (size_t j = 0; j < format->bases.nr; j++) {
+ CALLOC_ARRAY(array->items[i]->counts, bases_nr);
+ for (size_t j = 0; j < bases_nr; j++) {
struct ahead_behind_count *count;
count = &array->counts[array->counts_nr++];
count->tip_index = commits_nr;
@@ -3124,14 +3134,20 @@ void filter_ahead_behind(struct repository *r,
}
void filter_is_base(struct repository *r,
- struct ref_format *format,
struct ref_array *array)
{
struct commit **bases;
- size_t bases_nr = 0;
+ size_t bases_nr = 0, is_base_nr;
struct ref_array_item **back_index;
- if (!format->is_base_tips.nr || !array->nr)
+ if (!array->nr)
+ return;
+
+ for (size_t i = is_base_nr = 0; i < used_atom_cnt; i++) {
+ if (used_atom[i].atom_type == ATOM_ISBASE)
+ is_base_nr++;
+ }
+ if (!is_base_nr)
return;
CALLOC_ARRAY(back_index, array->nr);
@@ -3141,7 +3157,7 @@ void filter_is_base(struct repository *r,
const char *name = array->items[i]->refname;
struct commit *c = lookup_commit_reference_by_name_gently(name, 1);
- CALLOC_ARRAY(array->items[i]->is_base, format->is_base_tips.nr);
+ CALLOC_ARRAY(array->items[i]->is_base, is_base_nr);
if (!c)
continue;
@@ -3151,15 +3167,20 @@ void filter_is_base(struct repository *r,
bases_nr++;
}
- for (size_t i = 0; i < format->is_base_tips.nr; i++) {
- struct commit *tip = format->is_base_tips.items[i].util;
- int base_index = get_branch_base_for_tip(r, tip, bases, bases_nr);
+ for (size_t i = 0, j = 0; i < used_atom_cnt; i++) {
+ struct commit *tip;
+ int base_index;
+
+ if (used_atom[i].atom_type != ATOM_ISBASE)
+ continue;
+ tip = used_atom[i].u.base.commit;
+ base_index = get_branch_base_for_tip(r, tip, bases, bases_nr);
if (base_index < 0)
continue;
/* Store the string for use in output later. */
- back_index[base_index]->is_base[i] = xstrdup(format->is_base_tips.items[i].string);
+ back_index[base_index]->is_base[j++] = xstrdup(used_atom[i].u.base.name);
}
free(back_index);
@@ -3251,8 +3272,7 @@ struct ref_sorting {
};
static inline int can_do_iterative_format(struct ref_filter *filter,
- struct ref_sorting *sorting,
- struct ref_format *format)
+ struct ref_sorting *sorting)
{
/*
* Reference backends sort patterns lexicographically by refname, so if
@@ -3276,17 +3296,20 @@ static inline int can_do_iterative_format(struct ref_filter *filter,
* - filtering on reachability
* - including ahead-behind information in the formatted output
*/
- return !(filter->reachable_from ||
- filter->unreachable_from ||
- format->bases.nr ||
- format->is_base_tips.nr);
+ for (size_t i = 0; i < used_atom_cnt; i++) {
+ if (used_atom[i].atom_type == ATOM_AHEADBEHIND)
+ return 0;
+ if (used_atom[i].atom_type == ATOM_ISBASE)
+ return 0;
+ }
+ return !(filter->reachable_from || filter->unreachable_from);
}
void filter_and_format_refs(struct ref_filter *filter, unsigned int type,
struct ref_sorting *sorting,
struct ref_format *format)
{
- if (can_do_iterative_format(filter, sorting, format)) {
+ if (can_do_iterative_format(filter, sorting)) {
int save_commit_buffer_orig;
struct ref_filter_and_format_cbdata ref_cbdata = {
.filter = filter,
@@ -3302,8 +3325,8 @@ void filter_and_format_refs(struct ref_filter *filter, unsigned int type,
} else {
struct ref_array array = { 0 };
filter_refs(&array, filter, type);
- filter_ahead_behind(the_repository, format, &array);
- filter_is_base(the_repository, format, &array);
+ filter_ahead_behind(the_repository, &array);
+ filter_is_base(the_repository, &array);
ref_array_sort(sorting, &array);
print_formatted_ref_array(&array, format);
ref_array_clear(&array);
@@ -3637,16 +3660,3 @@ void ref_filter_clear(struct ref_filter *filter)
free_commit_list(filter->unreachable_from);
ref_filter_init(filter);
}
-
-void ref_format_init(struct ref_format *format)
-{
- struct ref_format blank = REF_FORMAT_INIT;
- memcpy(format, &blank, sizeof(blank));
-}
-
-void ref_format_clear(struct ref_format *format)
-{
- string_list_clear(&format->bases, 0);
- string_list_clear(&format->is_base_tips, 0);
- ref_format_init(format);
-}
diff --git a/ref-filter.h b/ref-filter.h
index 754038ab07..013d4cfa64 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -99,12 +99,6 @@ struct ref_format {
/* Internal state to ref-filter */
int need_color_reset_at_eol;
- /* List of bases for ahead-behind counts. */
- struct string_list bases;
-
- /* List of bases for is-base indicators. */
- struct string_list is_base_tips;
-
struct {
int max_count;
int omit_empty;
@@ -117,8 +111,6 @@ struct ref_format {
}
#define REF_FORMAT_INIT { \
.use_color = -1, \
- .bases = STRING_LIST_INIT_DUP, \
- .is_base_tips = STRING_LIST_INIT_DUP, \
}
/* Macros for checking --merged and --no-merged options */
@@ -205,7 +197,6 @@ struct ref_array_item *ref_array_push(struct ref_array *array,
* If this is not called, then any ahead-behind atoms will be blank.
*/
void filter_ahead_behind(struct repository *r,
- struct ref_format *format,
struct ref_array *array);
/*
@@ -215,13 +206,9 @@ void filter_ahead_behind(struct repository *r,
* If this is not called, then any is-base atoms will be blank.
*/
void filter_is_base(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);
-void ref_format_init(struct ref_format *format);
-void ref_format_clear(struct ref_format *format);
-
#endif /* REF_FILTER_H */
diff --git a/reflog.c b/reflog.c
index aeab78c9b7..1b5f031f6d 100644
--- a/reflog.c
+++ b/reflog.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/refs.c b/refs.c
index c36bc57a6c..37b8cfb90c 100644
--- a/refs.c
+++ b/refs.c
@@ -3,6 +3,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "advice.h"
@@ -699,6 +700,53 @@ static char *substitute_branch_name(struct repository *r,
return NULL;
}
+void copy_branchname(struct strbuf *sb, const char *name, unsigned allowed)
+{
+ int len = strlen(name);
+ struct interpret_branch_name_options options = {
+ .allowed = allowed
+ };
+ int used = repo_interpret_branch_name(the_repository, name, len, sb,
+ &options);
+
+ if (used < 0)
+ used = 0;
+ strbuf_add(sb, name + used, len - used);
+}
+
+int check_branch_ref(struct strbuf *sb, const char *name)
+{
+ if (startup_info->have_repository)
+ copy_branchname(sb, name, INTERPRET_BRANCH_LOCAL);
+ else
+ strbuf_addstr(sb, name);
+
+ /*
+ * This splice must be done even if we end up rejecting the
+ * name; builtin/branch.c::copy_or_rename_branch() still wants
+ * to see what the name expanded to so that "branch -m" can be
+ * used as a tool to correct earlier mistakes.
+ */
+ strbuf_splice(sb, 0, 0, "refs/heads/", 11);
+
+ if (*name == '-' ||
+ !strcmp(sb->buf, "refs/heads/HEAD"))
+ return -1;
+
+ return check_refname_format(sb->buf, 0);
+}
+
+int check_tag_ref(struct strbuf *sb, const char *name)
+{
+ if (name[0] == '-' || !strcmp(name, "HEAD"))
+ return -1;
+
+ strbuf_reset(sb);
+ strbuf_addf(sb, "refs/tags/%s", name);
+
+ return check_refname_format(sb->buf, 0);
+}
+
int repo_dwim_ref(struct repository *r, const char *str, int len,
struct object_id *oid, char **ref, int nonfatal_dangling_mark)
{
@@ -2173,19 +2221,53 @@ int peel_iterated_oid(struct repository *r, const struct object_id *base, struct
int refs_update_symref(struct ref_store *refs, const char *ref,
const char *target, const char *logmsg)
{
+ return refs_update_symref_extended(refs, ref, target, logmsg, NULL, 0);
+}
+
+int refs_update_symref_extended(struct ref_store *refs, const char *ref,
+ const char *target, const char *logmsg,
+ struct strbuf *referent, int create_only)
+{
struct ref_transaction *transaction;
struct strbuf err = STRBUF_INIT;
- int ret = 0;
+ int ret = 0, prepret = 0;
transaction = ref_store_transaction_begin(refs, 0, &err);
- if (!transaction ||
- ref_transaction_update(transaction, ref, NULL, NULL,
- target, NULL, REF_NO_DEREF,
- logmsg, &err) ||
- ref_transaction_commit(transaction, &err)) {
+ if (!transaction) {
+ error_return:
ret = error("%s", err.buf);
+ goto cleanup;
+ }
+ if (create_only) {
+ if (ref_transaction_create(transaction, ref, NULL, target,
+ REF_NO_DEREF, logmsg, &err))
+ goto error_return;
+ prepret = ref_transaction_prepare(transaction, &err);
+ if (prepret && prepret != TRANSACTION_CREATE_EXISTS)
+ goto error_return;
+ } else {
+ if (ref_transaction_update(transaction, ref, NULL, NULL,
+ target, NULL, REF_NO_DEREF,
+ logmsg, &err) ||
+ ref_transaction_prepare(transaction, &err))
+ goto error_return;
+ }
+
+ if (referent && refs_read_symbolic_ref(refs, ref, referent) == NOT_A_SYMREF) {
+ struct object_id oid;
+ if (!refs_read_ref(refs, ref, &oid)) {
+ strbuf_addstr(referent, oid_to_hex(&oid));
+ ret = NOT_A_SYMREF;
+ }
}
+ if (prepret == TRANSACTION_CREATE_EXISTS)
+ goto cleanup;
+
+ if (ref_transaction_commit(transaction, &err))
+ goto error_return;
+
+cleanup:
strbuf_release(&err);
if (transaction)
ref_transaction_free(transaction);
@@ -3034,4 +3116,3 @@ int ref_update_expects_existing_old_ref(struct ref_update *update)
return (update->flags & REF_HAVE_OLD) &&
(!is_null_oid(&update->old_oid) || update->old_target);
}
-
diff --git a/refs.h b/refs.h
index b0dfc65ed2..a0cdd99250 100644
--- a/refs.h
+++ b/refs.h
@@ -83,6 +83,17 @@ int refs_read_ref_full(struct ref_store *refs, const char *refname,
int refs_read_ref(struct ref_store *refs, const char *refname, struct object_id *oid);
+#define NOT_A_SYMREF -2
+
+/*
+ * Read the symbolic ref named "refname" and write its immediate referent into
+ * the provided buffer. Referent is left empty if "refname" is not a symbolic
+ * ref. It does not resolve the symbolic reference recursively in case the
+ * target is also a symbolic ref.
+ *
+ * Returns 0 on success, -2 if the "refname" is not a symbolic ref,
+ * -1 otherwise.
+ */
int refs_read_symbolic_ref(struct ref_store *ref_store, const char *refname,
struct strbuf *referent);
@@ -184,6 +195,35 @@ int repo_dwim_log(struct repository *r, const char *str, int len, struct object_
char *repo_default_branch_name(struct repository *r, int quiet);
/*
+ * Copy "name" to "sb", expanding any special @-marks as handled by
+ * repo_interpret_branch_name(). The result is a non-qualified branch name
+ * (so "foo" or "origin/master" instead of "refs/heads/foo" or
+ * "refs/remotes/origin/master").
+ *
+ * Note that the resulting name may not be a syntactically valid refname.
+ *
+ * If "allowed" is non-zero, restrict the set of allowed expansions. See
+ * repo_interpret_branch_name() for details.
+ */
+void copy_branchname(struct strbuf *sb, const char *name,
+ unsigned allowed);
+
+/*
+ * Like copy_branchname() above, but confirm that the result is
+ * syntactically valid to be used as a local branch name in refs/heads/.
+ *
+ * The return value is "0" if the result is valid, and "-1" otherwise.
+ */
+int check_branch_ref(struct strbuf *sb, const char *name);
+
+/*
+ * Similar for a tag name in refs/tags/.
+ *
+ * The return value is "0" if the result is valid, and "-1" otherwise.
+ */
+int check_tag_ref(struct strbuf *sb, const char *name);
+
+/*
* A ref_transaction represents a collection of reference updates that
* should succeed or fail together.
*
@@ -575,6 +615,10 @@ int refs_copy_existing_ref(struct ref_store *refs, const char *oldref,
int refs_update_symref(struct ref_store *refs, const char *refname,
const char *target, const char *logmsg);
+int refs_update_symref_extended(struct ref_store *refs, const char *refname,
+ const char *target, const char *logmsg,
+ struct strbuf *referent, int create_only);
+
enum action_on_err {
UPDATE_REFS_MSG_ON_ERR,
UPDATE_REFS_DIE_ON_ERR,
@@ -790,8 +834,10 @@ int ref_transaction_verify(struct ref_transaction *transaction,
/* Naming conflict (for example, the ref names A and A/B conflict). */
#define TRANSACTION_NAME_CONFLICT -1
+/* When only creation was requested, but the ref already exists. */
+#define TRANSACTION_CREATE_EXISTS -2
/* All other errors. */
-#define TRANSACTION_GENERIC_ERROR -2
+#define TRANSACTION_GENERIC_ERROR -3
/*
* Perform the preparatory stages of committing `transaction`. Acquire
diff --git a/refs/debug.c b/refs/debug.c
index a893ae0c90..fbc4df08b4 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -83,9 +83,8 @@ static void print_update(int i, const char *refname,
static void print_transaction(struct ref_transaction *transaction)
{
- int i;
trace_printf_key(&trace_refs, "transaction {\n");
- for (i = 0; i < transaction->nr; i++) {
+ for (size_t i = 0; i < transaction->nr; i++) {
struct ref_update *u = transaction->updates[i];
print_update(i, u->refname, &u->old_oid, &u->new_oid, u->flags,
u->type, u->msg);
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8953d1c6d3..29f08dced4 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "../git-compat-util.h"
#include "../abspath.h"
@@ -599,10 +600,9 @@ static int files_read_symbolic_ref(struct ref_store *ref_store, const char *refn
unsigned int type;
ret = read_ref_internal(ref_store, refname, &oid, referent, &type, &failure_errno, 1);
- if (ret)
- return ret;
-
- return !(type & REF_ISSYMREF);
+ if (!ret && !(type & REF_ISSYMREF))
+ return NOT_A_SYMREF;
+ return ret;
}
int parse_loose_ref_contents(const struct git_hash_algo *algop,
@@ -2519,14 +2519,18 @@ static int split_symref_update(struct ref_update *update,
static int check_old_oid(struct ref_update *update, struct object_id *oid,
struct strbuf *err)
{
+ int ret = TRANSACTION_GENERIC_ERROR;
+
if (!(update->flags & REF_HAVE_OLD) ||
oideq(oid, &update->old_oid))
return 0;
- if (is_null_oid(&update->old_oid))
+ if (is_null_oid(&update->old_oid)) {
strbuf_addf(err, "cannot lock ref '%s': "
"reference already exists",
ref_update_original_update_refname(update));
+ ret = TRANSACTION_CREATE_EXISTS;
+ }
else if (is_null_oid(oid))
strbuf_addf(err, "cannot lock ref '%s': "
"reference is missing but expected %s",
@@ -2539,7 +2543,7 @@ static int check_old_oid(struct ref_update *update, struct object_id *oid,
oid_to_hex(oid),
oid_to_hex(&update->old_oid));
- return -1;
+ return ret;
}
struct files_transaction_backend_data {
@@ -2611,9 +2615,6 @@ static int lock_ref_for_update(struct files_ref_store *refs,
update->backend_data = lock;
- if (update->flags & REF_LOG_ONLY)
- goto out;
-
if (update->type & REF_ISSYMREF) {
if (update->flags & REF_NO_DEREF) {
/*
@@ -2638,9 +2639,11 @@ static int lock_ref_for_update(struct files_ref_store *refs,
ret = TRANSACTION_GENERIC_ERROR;
goto out;
}
- } else if (check_old_oid(update, &lock->old_oid, err)) {
- ret = TRANSACTION_GENERIC_ERROR;
- goto out;
+ } else {
+ ret = check_old_oid(update, &lock->old_oid, err);
+ if (ret) {
+ goto out;
+ }
}
} else {
/*
@@ -2671,9 +2674,11 @@ static int lock_ref_for_update(struct files_ref_store *refs,
update->old_target);
ret = TRANSACTION_GENERIC_ERROR;
goto out;
- } else if (check_old_oid(update, &lock->old_oid, err)) {
- ret = TRANSACTION_GENERIC_ERROR;
- goto out;
+ } else {
+ ret = check_old_oid(update, &lock->old_oid, err);
+ if (ret) {
+ goto out;
+ }
}
/*
diff --git a/refs/iterator.c b/refs/iterator.c
index 8e999d81fc..d25e568bf0 100644
--- a/refs/iterator.c
+++ b/refs/iterator.c
@@ -3,6 +3,8 @@
* documentation about the design and use of reference iterators.
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "refs.h"
#include "refs/refs-internal.h"
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 3406f1e71d..a7b6f74b6e 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "../git-compat-util.h"
#include "../config.h"
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 79b287c5ec..16550862d3 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -683,6 +683,11 @@ struct ref_storage_be {
ref_iterator_begin_fn *iterator_begin;
read_raw_ref_fn *read_raw_ref;
+
+ /*
+ * Please refer to `refs_read_symbolic_ref()` for the expected
+ * behaviour.
+ */
read_symbolic_ref_fn *read_symbolic_ref;
reflog_iterator_begin_fn *reflog_iterator_begin;
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
index bec5962deb..00d95a9a2f 100644
--- a/refs/reftable-backend.c
+++ b/refs/reftable-backend.c
@@ -15,6 +15,7 @@
#include "../object.h"
#include "../path.h"
#include "../refs.h"
+#include "../reftable/reftable-basics.h"
#include "../reftable/reftable-stack.h"
#include "../reftable/reftable-record.h"
#include "../reftable/reftable-error.h"
@@ -23,6 +24,7 @@
#include "../setup.h"
#include "../strmap.h"
#include "../trace2.h"
+#include "../write-or-die.h"
#include "parse.h"
#include "refs-internal.h"
@@ -32,24 +34,111 @@
*/
#define REF_UPDATE_VIA_HEAD (1 << 8)
+struct reftable_backend {
+ struct reftable_stack *stack;
+ struct reftable_iterator it;
+};
+
+static void reftable_backend_on_reload(void *payload)
+{
+ struct reftable_backend *be = payload;
+ reftable_iterator_destroy(&be->it);
+}
+
+static int reftable_backend_init(struct reftable_backend *be,
+ const char *path,
+ const struct reftable_write_options *_opts)
+{
+ struct reftable_write_options opts = *_opts;
+ opts.on_reload = reftable_backend_on_reload;
+ opts.on_reload_payload = be;
+ return reftable_new_stack(&be->stack, path, &opts);
+}
+
+static void reftable_backend_release(struct reftable_backend *be)
+{
+ reftable_stack_destroy(be->stack);
+ be->stack = NULL;
+ reftable_iterator_destroy(&be->it);
+}
+
+static int reftable_backend_read_ref(struct reftable_backend *be,
+ const char *refname,
+ struct object_id *oid,
+ struct strbuf *referent,
+ unsigned int *type)
+{
+ struct reftable_ref_record ref = {0};
+ int ret;
+
+ if (!be->it.ops) {
+ ret = reftable_stack_init_ref_iterator(be->stack, &be->it);
+ if (ret)
+ goto done;
+ }
+
+ ret = reftable_iterator_seek_ref(&be->it, refname);
+ if (ret)
+ goto done;
+
+ ret = reftable_iterator_next_ref(&be->it, &ref);
+ if (ret)
+ goto done;
+
+ if (strcmp(ref.refname, refname)) {
+ ret = 1;
+ goto done;
+ }
+
+ if (ref.value_type == REFTABLE_REF_SYMREF) {
+ strbuf_reset(referent);
+ strbuf_addstr(referent, ref.value.symref);
+ *type |= REF_ISSYMREF;
+ } else if (reftable_ref_record_val1(&ref)) {
+ unsigned int hash_id;
+
+ switch (reftable_stack_hash_id(be->stack)) {
+ case REFTABLE_HASH_SHA1:
+ hash_id = GIT_HASH_SHA1;
+ break;
+ case REFTABLE_HASH_SHA256:
+ hash_id = GIT_HASH_SHA256;
+ break;
+ default:
+ BUG("unhandled hash ID %d", reftable_stack_hash_id(be->stack));
+ }
+
+ oidread(oid, reftable_ref_record_val1(&ref),
+ &hash_algos[hash_id]);
+ } else {
+ /* We got a tombstone, which should not happen. */
+ BUG("unhandled reference value type %d", ref.value_type);
+ }
+
+done:
+ assert(ret != REFTABLE_API_ERROR);
+ reftable_ref_record_release(&ref);
+ return ret;
+}
+
struct reftable_ref_store {
struct ref_store base;
/*
- * The main stack refers to the common dir and thus contains common
+ * The main backend refers to the common dir and thus contains common
* refs as well as refs of the main repository.
*/
- struct reftable_stack *main_stack;
+ struct reftable_backend main_backend;
/*
- * The worktree stack refers to the gitdir in case the refdb is opened
+ * The worktree backend refers to the gitdir in case the refdb is opened
* via a worktree. It thus contains the per-worktree refs.
*/
- struct reftable_stack *worktree_stack;
+ struct reftable_backend worktree_backend;
/*
- * Map of worktree stacks by their respective worktree names. The map
+ * Map of worktree backends by their respective worktree names. The map
* is populated lazily when we try to resolve `worktrees/$worktree` refs.
*/
- struct strmap worktree_stacks;
+ struct strmap worktree_backends;
struct reftable_write_options write_options;
unsigned int store_flags;
@@ -95,21 +184,25 @@ static struct reftable_ref_store *reftable_be_downcast(struct ref_store *ref_sto
* like `worktrees/$worktree/refs/heads/foo` as worktree stacks will store
* those references in their normalized form.
*/
-static struct reftable_stack *stack_for(struct reftable_ref_store *store,
- const char *refname,
- const char **rewritten_ref)
+static int backend_for(struct reftable_backend **out,
+ struct reftable_ref_store *store,
+ const char *refname,
+ const char **rewritten_ref,
+ int reload)
{
+ struct reftable_backend *be;
const char *wtname;
int wtname_len;
- if (!refname)
- return store->main_stack;
+ if (!refname) {
+ be = &store->main_backend;
+ goto out;
+ }
switch (parse_worktree_ref(refname, &wtname, &wtname_len, rewritten_ref)) {
case REF_WORKTREE_OTHER: {
static struct strbuf wtname_buf = STRBUF_INIT;
struct strbuf wt_dir = STRBUF_INIT;
- struct reftable_stack *stack;
/*
* We're using a static buffer here so that we don't need to
@@ -123,40 +216,55 @@ static struct reftable_stack *stack_for(struct reftable_ref_store *store,
/*
* There is an edge case here: when the worktree references the
* current worktree, then we set up the stack once via
- * `worktree_stacks` and once via `worktree_stack`. This is
+ * `worktree_backends` and once via `worktree_backend`. This is
* wasteful, but in the reading case it shouldn't matter. And
* in the writing case we would notice that the stack is locked
* already and error out when trying to write a reference via
* both stacks.
*/
- stack = strmap_get(&store->worktree_stacks, wtname_buf.buf);
- if (!stack) {
+ be = strmap_get(&store->worktree_backends, wtname_buf.buf);
+ if (!be) {
strbuf_addf(&wt_dir, "%s/worktrees/%s/reftable",
store->base.repo->commondir, wtname_buf.buf);
- store->err = reftable_new_stack(&stack, wt_dir.buf,
- &store->write_options);
+ CALLOC_ARRAY(be, 1);
+ store->err = reftable_backend_init(be, wt_dir.buf,
+ &store->write_options);
assert(store->err != REFTABLE_API_ERROR);
- strmap_put(&store->worktree_stacks, wtname_buf.buf, stack);
+
+ strmap_put(&store->worktree_backends, wtname_buf.buf, be);
}
strbuf_release(&wt_dir);
- return stack;
+ goto out;
}
case REF_WORKTREE_CURRENT:
/*
* If there is no worktree stack then we're currently in the
* main worktree. We thus return the main stack in that case.
*/
- if (!store->worktree_stack)
- return store->main_stack;
- return store->worktree_stack;
+ if (!store->worktree_backend.stack)
+ be = &store->main_backend;
+ else
+ be = &store->worktree_backend;
+ goto out;
case REF_WORKTREE_MAIN:
case REF_WORKTREE_SHARED:
- return store->main_stack;
+ be = &store->main_backend;
+ goto out;
default:
BUG("unhandled worktree reference type");
}
+
+out:
+ if (reload) {
+ int ret = reftable_stack_reload(be->stack);
+ if (ret)
+ return ret;
+ }
+ *out = be;
+
+ return 0;
}
static int should_write_log(struct reftable_ref_store *refs, const char *refname)
@@ -205,38 +313,6 @@ static void fill_reftable_log_record(struct reftable_log_record *log, const stru
log->value.update.tz_offset = sign * atoi(tz_begin);
}
-static int read_ref_without_reload(struct reftable_ref_store *refs,
- struct reftable_stack *stack,
- const char *refname,
- struct object_id *oid,
- struct strbuf *referent,
- unsigned int *type)
-{
- struct reftable_ref_record ref = {0};
- int ret;
-
- ret = reftable_stack_read_ref(stack, refname, &ref);
- if (ret)
- goto done;
-
- if (ref.value_type == REFTABLE_REF_SYMREF) {
- strbuf_reset(referent);
- strbuf_addstr(referent, ref.value.symref);
- *type |= REF_ISSYMREF;
- } else if (reftable_ref_record_val1(&ref)) {
- oidread(oid, reftable_ref_record_val1(&ref),
- refs->base.repo->hash_algo);
- } else {
- /* We got a tombstone, which should not happen. */
- BUG("unhandled reference value type %d", ref.value_type);
- }
-
-done:
- assert(ret != REFTABLE_API_ERROR);
- reftable_ref_record_release(&ref);
- return ret;
-}
-
static int reftable_be_config(const char *var, const char *value,
const struct config_context *ctx,
void *_opts)
@@ -272,6 +348,11 @@ static int reftable_be_config(const char *var, const char *value,
return 0;
}
+static int reftable_be_fsync(int fd)
+{
+ return fsync_component(FSYNC_COMPONENT_REFERENCE, fd);
+}
+
static struct ref_store *reftable_be_init(struct repository *repo,
const char *gitdir,
unsigned int store_flags)
@@ -285,15 +366,25 @@ static struct ref_store *reftable_be_init(struct repository *repo,
umask(mask);
base_ref_store_init(&refs->base, repo, gitdir, &refs_be_reftable);
- strmap_init(&refs->worktree_stacks);
+ strmap_init(&refs->worktree_backends);
refs->store_flags = store_flags;
refs->log_all_ref_updates = repo_settings_get_log_all_ref_updates(repo);
- refs->write_options.hash_id = repo->hash_algo->format_id;
+ switch (repo->hash_algo->format_id) {
+ case GIT_SHA1_FORMAT_ID:
+ refs->write_options.hash_id = REFTABLE_HASH_SHA1;
+ break;
+ case GIT_SHA256_FORMAT_ID:
+ refs->write_options.hash_id = REFTABLE_HASH_SHA256;
+ break;
+ default:
+ BUG("unknown hash algorithm %d", repo->hash_algo->format_id);
+ }
refs->write_options.default_permissions = calc_shared_perm(0666 & ~mask);
refs->write_options.disable_auto_compact =
!git_env_bool("GIT_TEST_REFTABLE_AUTOCOMPACTION", 1);
refs->write_options.lock_timeout_ms = 100;
+ refs->write_options.fsync = reftable_be_fsync;
git_config(reftable_be_config, &refs->write_options);
@@ -320,8 +411,8 @@ static struct ref_store *reftable_be_init(struct repository *repo,
strbuf_realpath(&path, gitdir, 0);
}
strbuf_addstr(&path, "/reftable");
- refs->err = reftable_new_stack(&refs->main_stack, path.buf,
- &refs->write_options);
+ refs->err = reftable_backend_init(&refs->main_backend, path.buf,
+ &refs->write_options);
if (refs->err)
goto done;
@@ -337,8 +428,8 @@ static struct ref_store *reftable_be_init(struct repository *repo,
strbuf_reset(&path);
strbuf_addf(&path, "%s/reftable", gitdir);
- refs->err = reftable_new_stack(&refs->worktree_stack, path.buf,
- &refs->write_options);
+ refs->err = reftable_backend_init(&refs->worktree_backend, path.buf,
+ &refs->write_options);
if (refs->err)
goto done;
}
@@ -357,19 +448,17 @@ static void reftable_be_release(struct ref_store *ref_store)
struct strmap_entry *entry;
struct hashmap_iter iter;
- if (refs->main_stack) {
- reftable_stack_destroy(refs->main_stack);
- refs->main_stack = NULL;
- }
+ if (refs->main_backend.stack)
+ reftable_backend_release(&refs->main_backend);
+ if (refs->worktree_backend.stack)
+ reftable_backend_release(&refs->worktree_backend);
- if (refs->worktree_stack) {
- reftable_stack_destroy(refs->worktree_stack);
- refs->worktree_stack = NULL;
+ strmap_for_each_entry(&refs->worktree_backends, &iter, entry) {
+ struct reftable_backend *be = entry->value;
+ reftable_backend_release(be);
+ free(be);
}
-
- strmap_for_each_entry(&refs->worktree_stacks, &iter, entry)
- reftable_stack_destroy(entry->value);
- strmap_clear(&refs->worktree_stacks, 0);
+ strmap_clear(&refs->worktree_backends, 0);
}
static int reftable_be_create_on_disk(struct ref_store *ref_store,
@@ -764,7 +853,7 @@ static struct ref_iterator *reftable_be_iterator_begin(struct ref_store *ref_sto
required_flags |= REF_STORE_ODB;
refs = reftable_be_downcast(ref_store, required_flags, "ref_iterator_begin");
- main_iter = ref_iterator_for_stack(refs, refs->main_stack, prefix,
+ main_iter = ref_iterator_for_stack(refs, refs->main_backend.stack, prefix,
exclude_patterns, flags);
/*
@@ -772,14 +861,14 @@ static struct ref_iterator *reftable_be_iterator_begin(struct ref_store *ref_sto
* right now. If we aren't, then we return the common reftable
* iterator, only.
*/
- if (!refs->worktree_stack)
+ if (!refs->worktree_backend.stack)
return &main_iter->base;
/*
* Otherwise we merge both the common and the per-worktree refs into a
* single iterator.
*/
- worktree_iter = ref_iterator_for_stack(refs, refs->worktree_stack, prefix,
+ worktree_iter = ref_iterator_for_stack(refs, refs->worktree_backend.stack, prefix,
exclude_patterns, flags);
return merge_ref_iterator_begin(&worktree_iter->base, &main_iter->base,
ref_iterator_select, NULL);
@@ -794,17 +883,17 @@ static int reftable_be_read_raw_ref(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_READ, "read_raw_ref");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
+ struct reftable_backend *be;
int ret;
if (refs->err < 0)
return refs->err;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&be, refs, refname, &refname, 1);
if (ret)
return ret;
- ret = read_ref_without_reload(refs, stack, refname, oid, referent, type);
+ ret = reftable_backend_read_ref(be, refname, oid, referent, type);
if (ret < 0)
return ret;
if (ret > 0) {
@@ -821,21 +910,22 @@ static int reftable_be_read_symbolic_ref(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_READ, "read_symbolic_ref");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
- struct reftable_ref_record ref = {0};
+ struct reftable_backend *be;
+ struct object_id oid;
+ unsigned int type = 0;
int ret;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&be, refs, refname, &refname, 1);
if (ret)
return ret;
- ret = reftable_stack_read_ref(stack, refname, &ref);
- if (ret == 0 && ref.value_type == REFTABLE_REF_SYMREF)
- strbuf_addstr(referent, ref.value.symref);
- else
+ ret = reftable_backend_read_ref(be, refname, &oid, referent, &type);
+ if (ret)
ret = -1;
-
- reftable_ref_record_release(&ref);
+ else if (type == REF_ISSYMREF)
+ ; /* happy */
+ else
+ ret = NOT_A_SYMREF;
return ret;
}
@@ -846,7 +936,7 @@ struct reftable_transaction_update {
struct write_transaction_table_arg {
struct reftable_ref_store *refs;
- struct reftable_stack *stack;
+ struct reftable_backend *be;
struct reftable_addition *addition;
struct reftable_transaction_update *updates;
size_t updates_nr;
@@ -881,27 +971,37 @@ static int prepare_transaction_update(struct write_transaction_table_arg **out,
struct ref_update *update,
struct strbuf *err)
{
- struct reftable_stack *stack = stack_for(refs, update->refname, NULL);
struct write_transaction_table_arg *arg = NULL;
+ struct reftable_backend *be;
size_t i;
int ret;
/*
+ * This function gets called in a loop, and we don't want to repeatedly
+ * reload the stack for every single ref update. Instead, we manually
+ * reload further down in the case where we haven't yet prepared the
+ * specific `reftable_backend`.
+ */
+ ret = backend_for(&be, refs, update->refname, NULL, 0);
+ if (ret)
+ return ret;
+
+ /*
* Search for a preexisting stack update. If there is one then we add
* the update to it, otherwise we set up a new stack update.
*/
for (i = 0; !arg && i < tx_data->args_nr; i++)
- if (tx_data->args[i].stack == stack)
+ if (tx_data->args[i].be == be)
arg = &tx_data->args[i];
if (!arg) {
struct reftable_addition *addition;
- ret = reftable_stack_reload(stack);
+ ret = reftable_stack_reload(be->stack);
if (ret)
return ret;
- ret = reftable_stack_new_addition(&addition, stack,
+ ret = reftable_stack_new_addition(&addition, be->stack,
REFTABLE_STACK_NEW_ADDITION_RELOAD);
if (ret) {
if (ret == REFTABLE_LOCK_ERROR)
@@ -913,7 +1013,7 @@ static int prepare_transaction_update(struct write_transaction_table_arg **out,
tx_data->args_alloc);
arg = &tx_data->args[tx_data->args_nr++];
arg->refs = refs;
- arg->stack = stack;
+ arg->be = be;
arg->addition = addition;
arg->updates = NULL;
arg->updates_nr = 0;
@@ -968,6 +1068,7 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
struct strbuf referent = STRBUF_INIT, head_referent = STRBUF_INIT;
struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
struct reftable_transaction_data *tx_data = NULL;
+ struct reftable_backend *be;
struct object_id head_oid;
unsigned int head_type = 0;
size_t i;
@@ -1015,8 +1116,23 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
goto done;
}
- ret = read_ref_without_reload(refs, stack_for(refs, "HEAD", NULL), "HEAD",
- &head_oid, &head_referent, &head_type);
+ /*
+ * TODO: it's dubious whether we should reload the stack that "HEAD"
+ * belongs to or not. In theory, it may happen that we only modify
+ * stacks which are _not_ part of the "HEAD" stack. In that case we
+ * wouldn't have prepared any transaction for its stack and would not
+ * have reloaded it, which may mean that it is stale.
+ *
+ * On the other hand, reloading that stack without locking it feels
+ * wrong, too, as the value of "HEAD" could be modified concurrently at
+ * any point in time.
+ */
+ ret = backend_for(&be, refs, "HEAD", NULL, 0);
+ if (ret)
+ goto done;
+
+ ret = reftable_backend_read_ref(be, "HEAD", &head_oid,
+ &head_referent, &head_type);
if (ret < 0)
goto done;
ret = 0;
@@ -1024,10 +1140,18 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
for (i = 0; i < transaction->nr; i++) {
struct ref_update *u = transaction->updates[i];
struct object_id current_oid = {0};
- struct reftable_stack *stack;
const char *rewritten_ref;
- stack = stack_for(refs, u->refname, &rewritten_ref);
+ /*
+ * There is no need to reload the respective backends here as
+ * we have already reloaded them when preparing the transaction
+ * update. And given that the stacks have been locked there
+ * shouldn't have been any concurrent modifications of the
+ * stack.
+ */
+ ret = backend_for(&be, refs, u->refname, &rewritten_ref, 0);
+ if (ret)
+ goto done;
/* Verify that the new object ID is valid. */
if ((u->flags & REF_HAVE_NEW) && !is_null_oid(&u->new_oid) &&
@@ -1084,8 +1208,8 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
string_list_insert(&affected_refnames, new_update->refname);
}
- ret = read_ref_without_reload(refs, stack, rewritten_ref,
- &current_oid, &referent, &u->type);
+ ret = reftable_backend_read_ref(be, rewritten_ref,
+ &current_oid, &referent, &u->type);
if (ret < 0)
goto done;
if (ret > 0 && !ref_update_expects_existing_old_ref(u)) {
@@ -1211,10 +1335,13 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
goto done;
}
} else if ((u->flags & REF_HAVE_OLD) && !oideq(&current_oid, &u->old_oid)) {
- if (is_null_oid(&u->old_oid))
+ ret = TRANSACTION_NAME_CONFLICT;
+ if (is_null_oid(&u->old_oid)) {
strbuf_addf(err, _("cannot lock ref '%s': "
"reference already exists"),
ref_update_original_update_refname(u));
+ ret = TRANSACTION_CREATE_EXISTS;
+ }
else if (is_null_oid(&current_oid))
strbuf_addf(err, _("cannot lock ref '%s': "
"reference is missing but expected %s"),
@@ -1226,7 +1353,6 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
ref_update_original_update_refname(u),
oid_to_hex(&current_oid),
oid_to_hex(&u->old_oid));
- ret = -1;
goto done;
}
@@ -1298,7 +1424,7 @@ static int transaction_update_cmp(const void *a, const void *b)
static int write_transaction_table(struct reftable_writer *writer, void *cb_data)
{
struct write_transaction_table_arg *arg = cb_data;
- uint64_t ts = reftable_stack_next_update_index(arg->stack);
+ uint64_t ts = reftable_stack_next_update_index(arg->be->stack);
struct reftable_log_record *logs = NULL;
struct ident_split committer_ident = {0};
size_t logs_nr = 0, logs_alloc = 0, i;
@@ -1335,7 +1461,7 @@ static int write_transaction_table(struct reftable_writer *writer, void *cb_data
struct reftable_log_record log = {0};
struct reftable_iterator it = {0};
- ret = reftable_stack_init_log_iterator(arg->stack, &it);
+ ret = reftable_stack_init_log_iterator(arg->be->stack, &it);
if (ret < 0)
goto done;
@@ -1540,9 +1666,9 @@ static int reftable_be_pack_refs(struct ref_store *ref_store,
if (refs->err)
return refs->err;
- stack = refs->worktree_stack;
+ stack = refs->worktree_backend.stack;
if (!stack)
- stack = refs->main_stack;
+ stack = refs->main_backend.stack;
if (opts->flags & PACK_REFS_AUTO)
ret = reftable_stack_auto_compact(stack);
@@ -1573,7 +1699,7 @@ struct write_create_symref_arg {
struct write_copy_arg {
struct reftable_ref_store *refs;
- struct reftable_stack *stack;
+ struct reftable_backend *be;
const char *oldname;
const char *newname;
const char *logmsg;
@@ -1598,7 +1724,7 @@ static int write_copy_table(struct reftable_writer *writer, void *cb_data)
if (split_ident_line(&committer_ident, committer_info, strlen(committer_info)))
BUG("failed splitting committer info");
- if (reftable_stack_read_ref(arg->stack, arg->oldname, &old_ref)) {
+ if (reftable_stack_read_ref(arg->be->stack, arg->oldname, &old_ref)) {
ret = error(_("refname %s not found"), arg->oldname);
goto done;
}
@@ -1637,7 +1763,7 @@ static int write_copy_table(struct reftable_writer *writer, void *cb_data)
* the old branch and the creation of the new branch, and we cannot do
* two changes to a reflog in a single update.
*/
- deletion_ts = creation_ts = reftable_stack_next_update_index(arg->stack);
+ deletion_ts = creation_ts = reftable_stack_next_update_index(arg->be->stack);
if (arg->delete_old)
creation_ts++;
reftable_writer_set_limits(writer, deletion_ts, creation_ts);
@@ -1680,8 +1806,8 @@ static int write_copy_table(struct reftable_writer *writer, void *cb_data)
memcpy(logs[logs_nr].value.update.old_hash, old_ref.value.val1, GIT_MAX_RAWSZ);
logs_nr++;
- ret = read_ref_without_reload(arg->refs, arg->stack, "HEAD", &head_oid,
- &head_referent, &head_type);
+ ret = reftable_backend_read_ref(arg->be, "HEAD", &head_oid,
+ &head_referent, &head_type);
if (ret < 0)
goto done;
append_head_reflog = (head_type & REF_ISSYMREF) && !strcmp(head_referent.buf, arg->oldname);
@@ -1724,7 +1850,7 @@ static int write_copy_table(struct reftable_writer *writer, void *cb_data)
* copy over all log entries from the old reflog. Last but not least,
* when renaming we also have to delete all the old reflog entries.
*/
- ret = reftable_stack_init_log_iterator(arg->stack, &it);
+ ret = reftable_stack_init_log_iterator(arg->be->stack, &it);
if (ret < 0)
goto done;
@@ -1797,10 +1923,8 @@ static int reftable_be_rename_ref(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_WRITE, "rename_ref");
- struct reftable_stack *stack = stack_for(refs, newrefname, &newrefname);
struct write_copy_arg arg = {
.refs = refs,
- .stack = stack,
.oldname = oldrefname,
.newname = newrefname,
.logmsg = logmsg,
@@ -1812,10 +1936,10 @@ static int reftable_be_rename_ref(struct ref_store *ref_store,
if (ret < 0)
goto done;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&arg.be, refs, newrefname, &newrefname, 1);
if (ret)
goto done;
- ret = reftable_stack_add(stack, &write_copy_table, &arg);
+ ret = reftable_stack_add(arg.be->stack, &write_copy_table, &arg);
done:
assert(ret != REFTABLE_API_ERROR);
@@ -1829,10 +1953,8 @@ static int reftable_be_copy_ref(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_WRITE, "copy_ref");
- struct reftable_stack *stack = stack_for(refs, newrefname, &newrefname);
struct write_copy_arg arg = {
.refs = refs,
- .stack = stack,
.oldname = oldrefname,
.newname = newrefname,
.logmsg = logmsg,
@@ -1843,10 +1965,10 @@ static int reftable_be_copy_ref(struct ref_store *ref_store,
if (ret < 0)
goto done;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&arg.be, refs, newrefname, &newrefname, 1);
if (ret)
goto done;
- ret = reftable_stack_add(stack, &write_copy_table, &arg);
+ ret = reftable_stack_add(arg.be->stack, &write_copy_table, &arg);
done:
assert(ret != REFTABLE_API_ERROR);
@@ -1967,11 +2089,11 @@ static struct ref_iterator *reftable_be_reflog_iterator_begin(struct ref_store *
reftable_be_downcast(ref_store, REF_STORE_READ, "reflog_iterator_begin");
struct reftable_reflog_iterator *main_iter, *worktree_iter;
- main_iter = reflog_iterator_for_stack(refs, refs->main_stack);
- if (!refs->worktree_stack)
+ main_iter = reflog_iterator_for_stack(refs, refs->main_backend.stack);
+ if (!refs->worktree_backend.stack)
return &main_iter->base;
- worktree_iter = reflog_iterator_for_stack(refs, refs->worktree_stack);
+ worktree_iter = reflog_iterator_for_stack(refs, refs->worktree_backend.stack);
return merge_ref_iterator_begin(&worktree_iter->base, &main_iter->base,
ref_iterator_select, NULL);
@@ -2010,15 +2132,23 @@ static int reftable_be_for_each_reflog_ent_reverse(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_READ, "for_each_reflog_ent_reverse");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
struct reftable_log_record log = {0};
struct reftable_iterator it = {0};
+ struct reftable_backend *be;
int ret;
if (refs->err < 0)
return refs->err;
- ret = reftable_stack_init_log_iterator(stack, &it);
+ /*
+ * TODO: we should adapt this callsite to reload the stack. There is no
+ * obvious reason why we shouldn't.
+ */
+ ret = backend_for(&be, refs, refname, &refname, 0);
+ if (ret)
+ goto done;
+
+ ret = reftable_stack_init_log_iterator(be->stack, &it);
if (ret < 0)
goto done;
@@ -2050,16 +2180,24 @@ static int reftable_be_for_each_reflog_ent(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_READ, "for_each_reflog_ent");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
struct reftable_log_record *logs = NULL;
struct reftable_iterator it = {0};
+ struct reftable_backend *be;
size_t logs_alloc = 0, logs_nr = 0, i;
int ret;
if (refs->err < 0)
return refs->err;
- ret = reftable_stack_init_log_iterator(stack, &it);
+ /*
+ * TODO: we should adapt this callsite to reload the stack. There is no
+ * obvious reason why we shouldn't.
+ */
+ ret = backend_for(&be, refs, refname, &refname, 0);
+ if (ret)
+ goto done;
+
+ ret = reftable_stack_init_log_iterator(be->stack, &it);
if (ret < 0)
goto done;
@@ -2099,20 +2237,20 @@ static int reftable_be_reflog_exists(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_READ, "reflog_exists");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
struct reftable_log_record log = {0};
struct reftable_iterator it = {0};
+ struct reftable_backend *be;
int ret;
ret = refs->err;
if (ret < 0)
goto done;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&be, refs, refname, &refname, 1);
if (ret < 0)
goto done;
- ret = reftable_stack_init_log_iterator(stack, &it);
+ ret = reftable_stack_init_log_iterator(be->stack, &it);
if (ret < 0)
goto done;
@@ -2184,10 +2322,9 @@ static int reftable_be_create_reflog(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_WRITE, "create_reflog");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
+ struct reftable_backend *be;
struct write_reflog_existence_arg arg = {
.refs = refs,
- .stack = stack,
.refname = refname,
};
int ret;
@@ -2196,11 +2333,12 @@ static int reftable_be_create_reflog(struct ref_store *ref_store,
if (ret < 0)
goto done;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&be, refs, refname, &refname, 1);
if (ret)
goto done;
+ arg.stack = be->stack;
- ret = reftable_stack_add(stack, &write_reflog_existence_table, &arg);
+ ret = reftable_stack_add(be->stack, &write_reflog_existence_table, &arg);
done:
return ret;
@@ -2258,17 +2396,18 @@ static int reftable_be_delete_reflog(struct ref_store *ref_store,
{
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_WRITE, "delete_reflog");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
+ struct reftable_backend *be;
struct write_reflog_delete_arg arg = {
- .stack = stack,
.refname = refname,
};
int ret;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&be, refs, refname, &refname, 1);
if (ret)
return ret;
- ret = reftable_stack_add(stack, &write_reflog_delete_table, &arg);
+ arg.stack = be->stack;
+
+ ret = reftable_stack_add(be->stack, &write_reflog_delete_table, &arg);
assert(ret != REFTABLE_API_ERROR);
return ret;
@@ -2367,26 +2506,27 @@ static int reftable_be_reflog_expire(struct ref_store *ref_store,
*/
struct reftable_ref_store *refs =
reftable_be_downcast(ref_store, REF_STORE_WRITE, "reflog_expire");
- struct reftable_stack *stack = stack_for(refs, refname, &refname);
struct reftable_log_record *logs = NULL;
struct reftable_log_record *rewritten = NULL;
- struct reftable_ref_record ref_record = {0};
struct reftable_iterator it = {0};
struct reftable_addition *add = NULL;
struct reflog_expiry_arg arg = {0};
+ struct reftable_backend *be;
struct object_id oid = {0};
+ struct strbuf referent = STRBUF_INIT;
uint8_t *last_hash = NULL;
size_t logs_nr = 0, logs_alloc = 0, i;
+ unsigned int type = 0;
int ret;
if (refs->err < 0)
return refs->err;
- ret = reftable_stack_reload(stack);
+ ret = backend_for(&be, refs, refname, &refname, 1);
if (ret < 0)
goto done;
- ret = reftable_stack_init_log_iterator(stack, &it);
+ ret = reftable_stack_init_log_iterator(be->stack, &it);
if (ret < 0)
goto done;
@@ -2394,16 +2534,13 @@ static int reftable_be_reflog_expire(struct ref_store *ref_store,
if (ret < 0)
goto done;
- ret = reftable_stack_new_addition(&add, stack, 0);
+ ret = reftable_stack_new_addition(&add, be->stack, 0);
if (ret < 0)
goto done;
- ret = reftable_stack_read_ref(stack, refname, &ref_record);
+ ret = reftable_backend_read_ref(be, refname, &oid, &referent, &type);
if (ret < 0)
goto done;
- if (reftable_ref_record_val1(&ref_record))
- oidread(&oid, reftable_ref_record_val1(&ref_record),
- ref_store->repo->hash_algo);
prepare_fn(refname, &oid, policy_cb_data);
while (1) {
@@ -2470,15 +2607,14 @@ static int reftable_be_reflog_expire(struct ref_store *ref_store,
}
}
- if (flags & EXPIRE_REFLOGS_UPDATE_REF && last_hash &&
- reftable_ref_record_val1(&ref_record))
+ if (flags & EXPIRE_REFLOGS_UPDATE_REF && last_hash && !is_null_oid(&oid))
oidread(&arg.update_oid, last_hash, ref_store->repo->hash_algo);
arg.refs = refs;
arg.records = rewritten;
arg.len = logs_nr;
- arg.stack = stack,
- arg.refname = refname,
+ arg.stack = be->stack;
+ arg.refname = refname;
ret = reftable_addition_add(add, &write_reflog_expiry_table, &arg);
if (ret < 0)
@@ -2496,11 +2632,11 @@ done:
cleanup_fn(policy_cb_data);
assert(ret != REFTABLE_API_ERROR);
- reftable_ref_record_release(&ref_record);
reftable_iterator_destroy(&it);
reftable_addition_destroy(add);
for (i = 0; i < logs_nr; i++)
reftable_log_record_release(&logs[i]);
+ strbuf_release(&referent);
free(logs);
free(rewritten);
return ret;
diff --git a/refspec.c b/refspec.c
index 994901f55b..6d86e04442 100644
--- a/refspec.c
+++ b/refspec.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/reftable/basics.c b/reftable/basics.c
index bc4fcc9144..3b5ea27bbd 100644
--- a/reftable/basics.c
+++ b/reftable/basics.c
@@ -17,6 +17,8 @@ static void (*reftable_free_ptr)(void *);
void *reftable_malloc(size_t sz)
{
+ if (!sz)
+ return NULL;
if (reftable_malloc_ptr)
return (*reftable_malloc_ptr)(sz);
return malloc(sz);
@@ -24,6 +26,11 @@ void *reftable_malloc(size_t sz)
void *reftable_realloc(void *p, size_t sz)
{
+ if (!sz) {
+ reftable_free(p);
+ return NULL;
+ }
+
if (reftable_realloc_ptr)
return (*reftable_realloc_ptr)(p, sz);
return realloc(p, sz);
@@ -117,11 +124,8 @@ int reftable_buf_add(struct reftable_buf *buf, const void *data, size_t len)
size_t newlen = buf->len + len;
if (newlen + 1 > buf->alloc) {
- char *reallocated = buf->buf;
- REFTABLE_ALLOC_GROW(reallocated, newlen + 1, buf->alloc);
- if (!reallocated)
+ if (REFTABLE_ALLOC_GROW(buf->buf, newlen + 1, buf->alloc))
return REFTABLE_OUT_OF_MEMORY_ERROR;
- buf->buf = reallocated;
}
memcpy(buf->buf + buf->len, data, len);
@@ -226,11 +230,9 @@ char **parse_names(char *buf, int size)
next = end;
}
if (p < next) {
- char **names_grown = names;
- REFTABLE_ALLOC_GROW(names_grown, names_len + 1, names_cap);
- if (!names_grown)
+ if (REFTABLE_ALLOC_GROW(names, names_len + 1,
+ names_cap))
goto err;
- names = names_grown;
names[names_len] = reftable_strdup(p);
if (!names[names_len++])
@@ -239,7 +241,8 @@ char **parse_names(char *buf, int size)
p = next + 1;
}
- REFTABLE_REALLOC_ARRAY(names, names_len + 1);
+ if (REFTABLE_ALLOC_GROW(names, names_len + 1, names_cap))
+ goto err;
names[names_len] = NULL;
return names;
@@ -260,25 +263,24 @@ int names_equal(const char **a, const char **b)
return a[i] == b[i];
}
-int common_prefix_size(struct reftable_buf *a, struct reftable_buf *b)
+size_t common_prefix_size(struct reftable_buf *a, struct reftable_buf *b)
{
- int p = 0;
- for (; p < a->len && p < b->len; p++) {
+ size_t p = 0;
+ for (; p < a->len && p < b->len; p++)
if (a->buf[p] != b->buf[p])
break;
- }
-
return p;
}
-int hash_size(uint32_t id)
+uint32_t hash_size(enum reftable_hash id)
{
+ if (!id)
+ return REFTABLE_HASH_SIZE_SHA1;
switch (id) {
- case 0:
- case GIT_SHA1_FORMAT_ID:
- return GIT_SHA1_RAWSZ;
- case GIT_SHA256_FORMAT_ID:
- return GIT_SHA256_RAWSZ;
+ case REFTABLE_HASH_SHA1:
+ return REFTABLE_HASH_SIZE_SHA1;
+ case REFTABLE_HASH_SHA256:
+ return REFTABLE_HASH_SIZE_SHA256;
}
abort();
}
diff --git a/reftable/basics.h b/reftable/basics.h
index 7aa46d7c30..a2a010a0e1 100644
--- a/reftable/basics.h
+++ b/reftable/basics.h
@@ -120,15 +120,38 @@ char *reftable_strdup(const char *str);
#define REFTABLE_ALLOC_ARRAY(x, alloc) (x) = reftable_malloc(st_mult(sizeof(*(x)), (alloc)))
#define REFTABLE_CALLOC_ARRAY(x, alloc) (x) = reftable_calloc((alloc), sizeof(*(x)))
#define REFTABLE_REALLOC_ARRAY(x, alloc) (x) = reftable_realloc((x), st_mult(sizeof(*(x)), (alloc)))
-#define REFTABLE_ALLOC_GROW(x, nr, alloc) \
- do { \
- if ((nr) > alloc) { \
- alloc = 2 * (alloc) + 1; \
- if (alloc < (nr)) \
- alloc = (nr); \
- REFTABLE_REALLOC_ARRAY(x, alloc); \
- } \
- } while (0)
+
+static inline void *reftable_alloc_grow(void *p, size_t nelem, size_t elsize,
+ size_t *allocp)
+{
+ void *new_p;
+ size_t alloc = *allocp * 2 + 1;
+ if (alloc < nelem)
+ alloc = nelem;
+ new_p = reftable_realloc(p, st_mult(elsize, alloc));
+ if (!new_p)
+ return p;
+ *allocp = alloc;
+ return new_p;
+}
+
+#define REFTABLE_ALLOC_GROW(x, nr, alloc) ( \
+ (nr) > (alloc) && ( \
+ (x) = reftable_alloc_grow((x), (nr), sizeof(*(x)), &(alloc)), \
+ (nr) > (alloc) \
+ ) \
+)
+
+#define REFTABLE_ALLOC_GROW_OR_NULL(x, nr, alloc) do { \
+ size_t reftable_alloc_grow_or_null_alloc = alloc; \
+ if (REFTABLE_ALLOC_GROW((x), (nr), reftable_alloc_grow_or_null_alloc)) { \
+ REFTABLE_FREE_AND_NULL(x); \
+ alloc = 0; \
+ } else { \
+ alloc = reftable_alloc_grow_or_null_alloc; \
+ } \
+} while (0)
+
#define REFTABLE_FREE_AND_NULL(p) do { reftable_free(p); (p) = NULL; } while (0)
#ifndef REFTABLE_ALLOW_BANNED_ALLOCATORS
@@ -146,8 +169,16 @@ char *reftable_strdup(const char *str);
#endif
/* Find the longest shared prefix size of `a` and `b` */
-int common_prefix_size(struct reftable_buf *a, struct reftable_buf *b);
+size_t common_prefix_size(struct reftable_buf *a, struct reftable_buf *b);
+
+uint32_t hash_size(enum reftable_hash id);
-int hash_size(uint32_t id);
+/*
+ * Format IDs that identify the hash function used by a reftable. Note that
+ * these constants end up on disk and thus mustn't change. The format IDs are
+ * "sha1" and "s256" in big endian, respectively.
+ */
+#define REFTABLE_FORMAT_ID_SHA1 ((uint32_t) 0x73686131)
+#define REFTABLE_FORMAT_ID_SHA256 ((uint32_t) 0x73323536)
#endif
diff --git a/reftable/block.c b/reftable/block.c
index 0198078485..8ac865ce78 100644
--- a/reftable/block.c
+++ b/reftable/block.c
@@ -15,7 +15,7 @@ https://developers.google.com/open-source/licenses/bsd
#include "system.h"
#include <zlib.h>
-int header_size(int version)
+size_t header_size(int version)
{
switch (version) {
case 1:
@@ -26,7 +26,7 @@ int header_size(int version)
abort();
}
-int footer_size(int version)
+size_t footer_size(int version)
{
switch (version) {
case 1:
@@ -40,20 +40,20 @@ int footer_size(int version)
static int block_writer_register_restart(struct block_writer *w, int n,
int is_restart, struct reftable_buf *key)
{
- int rlen, err;
+ uint32_t rlen;
+ int err;
rlen = w->restart_len;
- if (rlen >= MAX_RESTARTS) {
+ if (rlen >= MAX_RESTARTS)
is_restart = 0;
- }
- if (is_restart) {
+ if (is_restart)
rlen++;
- }
if (2 + 3 * rlen + n > w->block_size - w->next)
return -1;
if (is_restart) {
- REFTABLE_ALLOC_GROW(w->restarts, w->restart_len + 1, w->restart_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(w->restarts, w->restart_len + 1,
+ w->restart_cap);
if (!w->restarts)
return REFTABLE_OUT_OF_MEMORY_ERROR;
w->restarts[w->restart_len++] = w->next;
@@ -71,7 +71,7 @@ static int block_writer_register_restart(struct block_writer *w, int n,
}
int block_writer_init(struct block_writer *bw, uint8_t typ, uint8_t *block,
- uint32_t block_size, uint32_t header_off, int hash_size)
+ uint32_t block_size, uint32_t header_off, uint32_t hash_size)
{
bw->block = block;
bw->hash_size = hash_size;
@@ -147,8 +147,7 @@ done:
int block_writer_finish(struct block_writer *w)
{
- int i;
- for (i = 0; i < w->restart_len; i++) {
+ for (uint32_t i = 0; i < w->restart_len; i++) {
put_be24(w->block + w->next, w->restarts[i]);
w->next += 3;
}
@@ -176,7 +175,8 @@ int block_writer_finish(struct block_writer *w)
* is guaranteed to return `Z_STREAM_END`.
*/
compressed_len = deflateBound(w->zstream, src_len);
- REFTABLE_ALLOC_GROW(w->compressed, compressed_len, w->compressed_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(w->compressed, compressed_len,
+ w->compressed_cap);
if (!w->compressed) {
ret = REFTABLE_OUT_OF_MEMORY_ERROR;
return ret;
@@ -212,7 +212,7 @@ int block_writer_finish(struct block_writer *w)
int block_reader_init(struct block_reader *br, struct reftable_block *block,
uint32_t header_off, uint32_t table_block_size,
- int hash_size)
+ uint32_t hash_size)
{
uint32_t full_block_size = table_block_size;
uint8_t typ = block->data[header_off];
@@ -235,8 +235,8 @@ int block_reader_init(struct block_reader *br, struct reftable_block *block,
uLong src_len = block->len - block_header_skip;
/* Log blocks specify the *uncompressed* size in their header. */
- REFTABLE_ALLOC_GROW(br->uncompressed_data, sz,
- br->uncompressed_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(br->uncompressed_data, sz,
+ br->uncompressed_cap);
if (!br->uncompressed_data) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
diff --git a/reftable/block.h b/reftable/block.h
index 0431e8591f..bef2b8a4c5 100644
--- a/reftable/block.h
+++ b/reftable/block.h
@@ -30,7 +30,7 @@ struct block_writer {
/* How often to restart keys. */
uint16_t restart_interval;
- int hash_size;
+ uint32_t hash_size;
/* Offset of next uint8_t to write. */
uint32_t next;
@@ -48,7 +48,7 @@ struct block_writer {
* initializes the blockwriter to write `typ` entries, using `block` as temporary
* storage. `block` is not owned by the block_writer. */
int block_writer_init(struct block_writer *bw, uint8_t typ, uint8_t *block,
- uint32_t block_size, uint32_t header_off, int hash_size);
+ uint32_t block_size, uint32_t header_off, uint32_t hash_size);
/* returns the block type (eg. 'r' for ref records. */
uint8_t block_writer_type(struct block_writer *bw);
@@ -72,7 +72,7 @@ struct block_reader {
/* the memory block */
struct reftable_block block;
- int hash_size;
+ uint32_t hash_size;
/* Uncompressed data for log entries. */
z_stream *zstream;
@@ -92,7 +92,7 @@ struct block_reader {
/* initializes a block reader. */
int block_reader_init(struct block_reader *br, struct reftable_block *bl,
uint32_t header_off, uint32_t table_block_size,
- int hash_size);
+ uint32_t hash_size);
void block_reader_release(struct block_reader *br);
@@ -108,7 +108,7 @@ struct block_iter {
uint32_t next_off;
const unsigned char *block;
size_t block_len;
- int hash_size;
+ uint32_t hash_size;
/* key for last entry we read. */
struct reftable_buf last_key;
@@ -137,10 +137,10 @@ void block_iter_reset(struct block_iter *it);
void block_iter_close(struct block_iter *it);
/* size of file header, depending on format version */
-int header_size(int version);
+size_t header_size(int version);
/* size of file footer, depending on format version */
-int footer_size(int version);
+size_t footer_size(int version);
/* returns a block to its source. */
void reftable_block_done(struct reftable_block *ret);
diff --git a/reftable/blocksource.c b/reftable/blocksource.c
index 52e0915a67..bba4a45b98 100644
--- a/reftable/blocksource.c
+++ b/reftable/blocksource.c
@@ -24,8 +24,8 @@ static void reftable_buf_close(void *b UNUSED)
{
}
-static int reftable_buf_read_block(void *v, struct reftable_block *dest,
- uint64_t off, uint32_t size)
+static ssize_t reftable_buf_read_block(void *v, struct reftable_block *dest,
+ uint64_t off, uint32_t size)
{
struct reftable_buf *b = v;
assert(off + size <= b->len);
@@ -78,8 +78,8 @@ static void file_close(void *v)
reftable_free(b);
}
-static int file_read_block(void *v, struct reftable_block *dest, uint64_t off,
- uint32_t size)
+static ssize_t file_read_block(void *v, struct reftable_block *dest, uint64_t off,
+ uint32_t size)
{
struct file_block_source *b = v;
assert(off + size <= b->size);
diff --git a/reftable/merged.c b/reftable/merged.c
index 514d6facf4..e72b39e178 100644
--- a/reftable/merged.c
+++ b/reftable/merged.c
@@ -66,6 +66,8 @@ static int merged_iter_seek(struct merged_iter *mi, struct reftable_record *want
int err;
mi->advance_index = -1;
+ while (!merged_iter_pqueue_is_empty(mi->pq))
+ merged_iter_pqueue_remove(&mi->pq);
for (size_t i = 0; i < mi->subiters_len; i++) {
err = iterator_seek(&mi->subiters[i].iter, want);
@@ -181,7 +183,7 @@ static void iterator_from_merged_iter(struct reftable_iterator *it,
int reftable_merged_table_new(struct reftable_merged_table **dest,
struct reftable_reader **readers, size_t n,
- uint32_t hash_id)
+ enum reftable_hash hash_id)
{
struct reftable_merged_table *m = NULL;
uint64_t last_max = 0;
@@ -238,14 +240,16 @@ int merged_table_init_iter(struct reftable_merged_table *mt,
struct reftable_iterator *it,
uint8_t typ)
{
- struct merged_subiter *subiters;
+ struct merged_subiter *subiters = NULL;
struct merged_iter *mi = NULL;
int ret;
- REFTABLE_CALLOC_ARRAY(subiters, mt->readers_len);
- if (!subiters) {
- ret = REFTABLE_OUT_OF_MEMORY_ERROR;
- goto out;
+ if (mt->readers_len) {
+ REFTABLE_CALLOC_ARRAY(subiters, mt->readers_len);
+ if (!subiters) {
+ ret = REFTABLE_OUT_OF_MEMORY_ERROR;
+ goto out;
+ }
}
for (size_t i = 0; i < mt->readers_len; i++) {
@@ -293,7 +297,7 @@ int reftable_merged_table_init_log_iterator(struct reftable_merged_table *mt,
return merged_table_init_iter(mt, it, BLOCK_TYPE_LOG);
}
-uint32_t reftable_merged_table_hash_id(struct reftable_merged_table *mt)
+enum reftable_hash reftable_merged_table_hash_id(struct reftable_merged_table *mt)
{
return mt->hash_id;
}
diff --git a/reftable/merged.h b/reftable/merged.h
index 89bd0c4b35..0b7d939e92 100644
--- a/reftable/merged.h
+++ b/reftable/merged.h
@@ -10,11 +10,12 @@ https://developers.google.com/open-source/licenses/bsd
#define MERGED_H
#include "system.h"
+#include "reftable-basics.h"
struct reftable_merged_table {
struct reftable_reader **readers;
size_t readers_len;
- uint32_t hash_id;
+ enum reftable_hash hash_id;
/* If unset, produce deletions. This is useful for compaction. For the
* full stack, deletions should be produced. */
diff --git a/reftable/pq.c b/reftable/pq.c
index 6ee1164dd3..5591e875e1 100644
--- a/reftable/pq.c
+++ b/reftable/pq.c
@@ -49,7 +49,7 @@ int merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry
{
size_t i = 0;
- REFTABLE_ALLOC_GROW(pq->heap, pq->len + 1, pq->cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(pq->heap, pq->len + 1, pq->cap);
if (!pq->heap)
return REFTABLE_OUT_OF_MEMORY_ERROR;
pq->heap[pq->len++] = *e;
diff --git a/reftable/reader.c b/reftable/reader.c
index 90dc950b57..3f2e4b2800 100644
--- a/reftable/reader.c
+++ b/reftable/reader.c
@@ -20,11 +20,11 @@ uint64_t block_source_size(struct reftable_block_source *source)
return source->ops->size(source->arg);
}
-int block_source_read_block(struct reftable_block_source *source,
- struct reftable_block *dest, uint64_t off,
- uint32_t size)
+ssize_t block_source_read_block(struct reftable_block_source *source,
+ struct reftable_block *dest, uint64_t off,
+ uint32_t size)
{
- int result = source->ops->read_block(source->arg, dest, off, size);
+ ssize_t result = source->ops->read_block(source->arg, dest, off, size);
dest->source = *source;
return result;
}
@@ -57,17 +57,20 @@ static int reader_get_block(struct reftable_reader *r,
struct reftable_block *dest, uint64_t off,
uint32_t sz)
{
+ ssize_t bytes_read;
if (off >= r->size)
return 0;
-
- if (off + sz > r->size) {
+ if (off + sz > r->size)
sz = r->size - off;
- }
- return block_source_read_block(&r->source, dest, off, sz);
+ bytes_read = block_source_read_block(&r->source, dest, off, sz);
+ if (bytes_read < 0)
+ return (int)bytes_read;
+
+ return 0;
}
-uint32_t reftable_reader_hash_id(struct reftable_reader *r)
+enum reftable_hash reftable_reader_hash_id(struct reftable_reader *r)
{
return r->hash_id;
}
@@ -107,18 +110,20 @@ static int parse_footer(struct reftable_reader *r, uint8_t *footer,
f += 8;
if (r->version == 1) {
- r->hash_id = GIT_SHA1_FORMAT_ID;
+ r->hash_id = REFTABLE_HASH_SHA1;
} else {
- r->hash_id = get_be32(f);
- switch (r->hash_id) {
- case GIT_SHA1_FORMAT_ID:
+ switch (get_be32(f)) {
+ case REFTABLE_FORMAT_ID_SHA1:
+ r->hash_id = REFTABLE_HASH_SHA1;
break;
- case GIT_SHA256_FORMAT_ID:
+ case REFTABLE_FORMAT_ID_SHA256:
+ r->hash_id = REFTABLE_HASH_SHA256;
break;
default:
err = REFTABLE_FORMAT_ERROR;
goto done;
}
+
f += 4;
}
@@ -599,6 +604,7 @@ int reftable_reader_new(struct reftable_reader **out,
struct reftable_reader *r;
uint64_t file_size = block_source_size(source);
uint32_t read_size;
+ ssize_t bytes_read;
int err;
REFTABLE_CALLOC_ARRAY(r, 1);
@@ -617,8 +623,8 @@ int reftable_reader_new(struct reftable_reader **out,
goto done;
}
- err = block_source_read_block(source, &header, 0, read_size);
- if (err != read_size) {
+ bytes_read = block_source_read_block(source, &header, 0, read_size);
+ if (bytes_read < 0 || (size_t)bytes_read != read_size) {
err = REFTABLE_IO_ERROR;
goto done;
}
@@ -643,9 +649,9 @@ int reftable_reader_new(struct reftable_reader **out,
r->hash_id = 0;
r->refcount = 1;
- err = block_source_read_block(source, &footer, r->size,
- footer_size(r->version));
- if (err != footer_size(r->version)) {
+ bytes_read = block_source_read_block(source, &footer, r->size,
+ footer_size(r->version));
+ if (bytes_read < 0 || (size_t)bytes_read != footer_size(r->version)) {
err = REFTABLE_IO_ERROR;
goto done;
}
@@ -748,7 +754,7 @@ static int reftable_reader_refs_for_unindexed(struct reftable_reader *r,
struct table_iter *ti;
struct filtering_ref_iterator *filter = NULL;
struct filtering_ref_iterator empty = FILTERING_REF_ITERATOR_INIT;
- int oid_len = hash_size(r->hash_id);
+ uint32_t oid_len = hash_size(r->hash_id);
int err;
REFTABLE_ALLOC_ARRAY(ti, 1);
diff --git a/reftable/reader.h b/reftable/reader.h
index 010fbfe851..bb72108a6f 100644
--- a/reftable/reader.h
+++ b/reftable/reader.h
@@ -16,9 +16,9 @@ https://developers.google.com/open-source/licenses/bsd
uint64_t block_source_size(struct reftable_block_source *source);
-int block_source_read_block(struct reftable_block_source *source,
- struct reftable_block *dest, uint64_t off,
- uint32_t size);
+ssize_t block_source_read_block(struct reftable_block_source *source,
+ struct reftable_block *dest, uint64_t off,
+ uint32_t size);
void block_source_close(struct reftable_block_source *source);
/* metadata for a block type */
@@ -37,8 +37,8 @@ struct reftable_reader {
/* Size of the file, excluding the footer. */
uint64_t size;
- /* 'sha1' for SHA1, 's256' for SHA-256 */
- uint32_t hash_id;
+ /* The hash function used for ref records. */
+ enum reftable_hash hash_id;
uint32_t block_size;
uint64_t min_update_index;
diff --git a/reftable/record.c b/reftable/record.c
index fb5652ed57..8919df8a4d 100644
--- a/reftable/record.c
+++ b/reftable/record.c
@@ -21,47 +21,49 @@ static void *reftable_record_data(struct reftable_record *rec);
int get_var_int(uint64_t *dest, struct string_view *in)
{
- int ptr = 0;
+ const unsigned char *buf = in->buf;
+ unsigned char c;
uint64_t val;
- if (in->len == 0)
+ if (!in->len)
return -1;
- val = in->buf[ptr] & 0x7f;
-
- while (in->buf[ptr] & 0x80) {
- ptr++;
- if (ptr > in->len) {
+ c = *buf++;
+ val = c & 0x7f;
+
+ while (c & 0x80) {
+ /*
+ * We use a micro-optimization here: whenever we see that the
+ * 0x80 bit is set, we know that the remainder of the value
+ * cannot be 0. The zero-values thus doesn't need to be encoded
+ * at all, which is why we subtract 1 when encoding and add 1
+ * when decoding.
+ *
+ * This allows us to save a byte in some edge cases.
+ */
+ val += 1;
+ if (!val || (val & (uint64_t)(~0ULL << (64 - 7))))
+ return -1; /* overflow */
+ if (buf >= in->buf + in->len)
return -1;
- }
- val = (val + 1) << 7 | (uint64_t)(in->buf[ptr] & 0x7f);
+ c = *buf++;
+ val = (val << 7) + (c & 0x7f);
}
*dest = val;
- return ptr + 1;
+ return buf - in->buf;
}
-int put_var_int(struct string_view *dest, uint64_t val)
+int put_var_int(struct string_view *dest, uint64_t value)
{
- uint8_t buf[10] = { 0 };
- int i = 9;
- int n = 0;
- buf[i] = (uint8_t)(val & 0x7f);
- i--;
- while (1) {
- val >>= 7;
- if (!val) {
- break;
- }
- val--;
- buf[i] = 0x80 | (uint8_t)(val & 0x7f);
- i--;
- }
-
- n = sizeof(buf) - i - 1;
- if (dest->len < n)
+ unsigned char varint[10];
+ unsigned pos = sizeof(varint) - 1;
+ varint[pos] = value & 0x7f;
+ while (value >>= 7)
+ varint[--pos] = 0x80 | (--value & 0x7f);
+ if (dest->len < sizeof(varint) - pos)
return -1;
- memcpy(dest->buf, &buf[i + 1], n);
- return n;
+ memcpy(dest->buf, varint + pos, sizeof(varint) - pos);
+ return sizeof(varint) - pos;
}
int reftable_is_block_type(uint8_t typ)
@@ -124,7 +126,7 @@ static int decode_string(struct reftable_buf *dest, struct string_view in)
static int encode_string(const char *str, struct string_view s)
{
struct string_view start = s;
- int l = strlen(str);
+ size_t l = strlen(str);
int n = put_var_int(&s, l);
if (n < 0)
return -1;
@@ -142,9 +144,9 @@ int reftable_encode_key(int *restart, struct string_view dest,
uint8_t extra)
{
struct string_view start = dest;
- int prefix_len = common_prefix_size(&prev_key, &key);
+ size_t prefix_len = common_prefix_size(&prev_key, &key);
uint64_t suffix_len = key.len - prefix_len;
- int n = put_var_int(&dest, (uint64_t)prefix_len);
+ int n = put_var_int(&dest, prefix_len);
if (n < 0)
return -1;
string_view_consume(&dest, n);
@@ -227,7 +229,7 @@ static int reftable_ref_record_key(const void *r, struct reftable_buf *dest)
}
static int reftable_ref_record_copy_from(void *rec, const void *src_rec,
- int hash_size)
+ uint32_t hash_size)
{
struct reftable_ref_record *ref = rec;
const struct reftable_ref_record *src = src_rec;
@@ -235,8 +237,6 @@ static int reftable_ref_record_copy_from(void *rec, const void *src_rec,
size_t refname_cap = 0;
int err;
- assert(hash_size > 0);
-
SWAP(refname, ref->refname);
SWAP(refname_cap, ref->refname_cap);
reftable_ref_record_release(ref);
@@ -246,8 +246,8 @@ static int reftable_ref_record_copy_from(void *rec, const void *src_rec,
if (src->refname) {
size_t refname_len = strlen(src->refname);
- REFTABLE_ALLOC_GROW(ref->refname, refname_len + 1,
- ref->refname_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(ref->refname, refname_len + 1,
+ ref->refname_cap);
if (!ref->refname) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto out;
@@ -317,13 +317,12 @@ static uint8_t reftable_ref_record_val_type(const void *rec)
}
static int reftable_ref_record_encode(const void *rec, struct string_view s,
- int hash_size)
+ uint32_t hash_size)
{
const struct reftable_ref_record *r =
(const struct reftable_ref_record *)rec;
struct string_view start = s;
int n = put_var_int(&s, r->update_index);
- assert(hash_size > 0);
if (n < 0)
return -1;
string_view_consume(&s, n);
@@ -363,7 +362,7 @@ static int reftable_ref_record_encode(const void *rec, struct string_view s,
static int reftable_ref_record_decode(void *rec, struct reftable_buf key,
uint8_t val_type, struct string_view in,
- int hash_size, struct reftable_buf *scratch)
+ uint32_t hash_size, struct reftable_buf *scratch)
{
struct reftable_ref_record *r = rec;
struct string_view start = in;
@@ -372,8 +371,6 @@ static int reftable_ref_record_decode(void *rec, struct reftable_buf key,
size_t refname_cap = 0;
int n, err;
- assert(hash_size > 0);
-
n = get_var_int(&update_index, &in);
if (n < 0)
return n;
@@ -385,7 +382,7 @@ static int reftable_ref_record_decode(void *rec, struct reftable_buf key,
SWAP(r->refname, refname);
SWAP(r->refname_cap, refname_cap);
- REFTABLE_ALLOC_GROW(r->refname, key.len + 1, r->refname_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(r->refname, key.len + 1, r->refname_cap);
if (!r->refname) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
@@ -449,7 +446,7 @@ static int reftable_ref_record_is_deletion_void(const void *p)
}
static int reftable_ref_record_equal_void(const void *a,
- const void *b, int hash_size)
+ const void *b, uint32_t hash_size)
{
struct reftable_ref_record *ra = (struct reftable_ref_record *) a;
struct reftable_ref_record *rb = (struct reftable_ref_record *) b;
@@ -493,7 +490,7 @@ static void reftable_obj_record_release(void *rec)
}
static int reftable_obj_record_copy_from(void *rec, const void *src_rec,
- int hash_size UNUSED)
+ uint32_t hash_size UNUSED)
{
struct reftable_obj_record *obj = rec;
const struct reftable_obj_record *src = src_rec;
@@ -525,7 +522,7 @@ static uint8_t reftable_obj_record_val_type(const void *rec)
}
static int reftable_obj_record_encode(const void *rec, struct string_view s,
- int hash_size UNUSED)
+ uint32_t hash_size UNUSED)
{
const struct reftable_obj_record *r = rec;
struct string_view start = s;
@@ -560,7 +557,7 @@ static int reftable_obj_record_encode(const void *rec, struct string_view s,
static int reftable_obj_record_decode(void *rec, struct reftable_buf key,
uint8_t val_type, struct string_view in,
- int hash_size UNUSED,
+ uint32_t hash_size UNUSED,
struct reftable_buf *scratch UNUSED)
{
struct string_view start = in;
@@ -568,7 +565,6 @@ static int reftable_obj_record_decode(void *rec, struct reftable_buf key,
uint64_t count = val_type;
int n = 0;
uint64_t last;
- int j;
reftable_obj_record_release(r);
@@ -603,8 +599,7 @@ static int reftable_obj_record_decode(void *rec, struct reftable_buf key,
string_view_consume(&in, n);
last = r->offsets[0];
- j = 1;
- while (j < count) {
+ for (uint64_t j = 1; j < count; j++) {
uint64_t delta = 0;
int n = get_var_int(&delta, &in);
if (n < 0) {
@@ -613,7 +608,6 @@ static int reftable_obj_record_decode(void *rec, struct reftable_buf key,
string_view_consume(&in, n);
last = r->offsets[j] = (delta + last);
- j++;
}
return start.len - in.len;
}
@@ -624,7 +618,7 @@ static int not_a_deletion(const void *p UNUSED)
}
static int reftable_obj_record_equal_void(const void *a, const void *b,
- int hash_size UNUSED)
+ uint32_t hash_size UNUSED)
{
struct reftable_obj_record *ra = (struct reftable_obj_record *) a;
struct reftable_obj_record *rb = (struct reftable_obj_record *) b;
@@ -699,7 +693,7 @@ static int reftable_log_record_key(const void *r, struct reftable_buf *dest)
}
static int reftable_log_record_copy_from(void *rec, const void *src_rec,
- int hash_size)
+ uint32_t hash_size)
{
struct reftable_log_record *dst = rec;
const struct reftable_log_record *src =
@@ -780,7 +774,7 @@ static uint8_t reftable_log_record_val_type(const void *rec)
}
static int reftable_log_record_encode(const void *rec, struct string_view s,
- int hash_size)
+ uint32_t hash_size)
{
const struct reftable_log_record *r = rec;
struct string_view start = s;
@@ -828,7 +822,7 @@ static int reftable_log_record_encode(const void *rec, struct string_view s,
static int reftable_log_record_decode(void *rec, struct reftable_buf key,
uint8_t val_type, struct string_view in,
- int hash_size, struct reftable_buf *scratch)
+ uint32_t hash_size, struct reftable_buf *scratch)
{
struct string_view start = in;
struct reftable_log_record *r = rec;
@@ -839,7 +833,7 @@ static int reftable_log_record_decode(void *rec, struct reftable_buf key,
if (key.len <= 9 || key.buf[key.len - 9] != 0)
return REFTABLE_FORMAT_ERROR;
- REFTABLE_ALLOC_GROW(r->refname, key.len - 8, r->refname_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(r->refname, key.len - 8, r->refname_cap);
if (!r->refname) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
@@ -947,8 +941,8 @@ static int reftable_log_record_decode(void *rec, struct reftable_buf key,
}
string_view_consume(&in, n);
- REFTABLE_ALLOC_GROW(r->value.update.message, scratch->len + 1,
- r->value.update.message_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(r->value.update.message, scratch->len + 1,
+ r->value.update.message_cap);
if (!r->value.update.message) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
@@ -976,7 +970,7 @@ static int null_streq(const char *a, const char *b)
}
static int reftable_log_record_equal_void(const void *a,
- const void *b, int hash_size)
+ const void *b, uint32_t hash_size)
{
return reftable_log_record_equal((struct reftable_log_record *) a,
(struct reftable_log_record *) b,
@@ -1000,7 +994,7 @@ static int reftable_log_record_cmp_void(const void *_a, const void *_b)
}
int reftable_log_record_equal(const struct reftable_log_record *a,
- const struct reftable_log_record *b, int hash_size)
+ const struct reftable_log_record *b, uint32_t hash_size)
{
if (!(null_streq(a->refname, b->refname) &&
a->update_index == b->update_index &&
@@ -1054,7 +1048,7 @@ static int reftable_index_record_key(const void *r, struct reftable_buf *dest)
}
static int reftable_index_record_copy_from(void *rec, const void *src_rec,
- int hash_size UNUSED)
+ uint32_t hash_size UNUSED)
{
struct reftable_index_record *dst = rec;
const struct reftable_index_record *src = src_rec;
@@ -1081,7 +1075,7 @@ static uint8_t reftable_index_record_val_type(const void *rec UNUSED)
}
static int reftable_index_record_encode(const void *rec, struct string_view out,
- int hash_size UNUSED)
+ uint32_t hash_size UNUSED)
{
const struct reftable_index_record *r =
(const struct reftable_index_record *)rec;
@@ -1099,7 +1093,7 @@ static int reftable_index_record_encode(const void *rec, struct string_view out,
static int reftable_index_record_decode(void *rec, struct reftable_buf key,
uint8_t val_type UNUSED,
struct string_view in,
- int hash_size UNUSED,
+ uint32_t hash_size UNUSED,
struct reftable_buf *scratch UNUSED)
{
struct string_view start = in;
@@ -1120,7 +1114,7 @@ static int reftable_index_record_decode(void *rec, struct reftable_buf key,
}
static int reftable_index_record_equal(const void *a, const void *b,
- int hash_size UNUSED)
+ uint32_t hash_size UNUSED)
{
struct reftable_index_record *ia = (struct reftable_index_record *) a;
struct reftable_index_record *ib = (struct reftable_index_record *) b;
@@ -1154,14 +1148,14 @@ int reftable_record_key(struct reftable_record *rec, struct reftable_buf *dest)
}
int reftable_record_encode(struct reftable_record *rec, struct string_view dest,
- int hash_size)
+ uint32_t hash_size)
{
return reftable_record_vtable(rec)->encode(reftable_record_data(rec),
dest, hash_size);
}
int reftable_record_copy_from(struct reftable_record *rec,
- struct reftable_record *src, int hash_size)
+ struct reftable_record *src, uint32_t hash_size)
{
assert(src->type == rec->type);
@@ -1176,7 +1170,7 @@ uint8_t reftable_record_val_type(struct reftable_record *rec)
}
int reftable_record_decode(struct reftable_record *rec, struct reftable_buf key,
- uint8_t extra, struct string_view src, int hash_size,
+ uint8_t extra, struct string_view src, uint32_t hash_size,
struct reftable_buf *scratch)
{
return reftable_record_vtable(rec)->decode(reftable_record_data(rec),
@@ -1203,7 +1197,7 @@ int reftable_record_cmp(struct reftable_record *a, struct reftable_record *b)
reftable_record_data(a), reftable_record_data(b));
}
-int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, int hash_size)
+int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, uint32_t hash_size)
{
if (a->type != b->type)
return 0;
@@ -1211,7 +1205,7 @@ int reftable_record_equal(struct reftable_record *a, struct reftable_record *b,
reftable_record_data(a), reftable_record_data(b), hash_size);
}
-static int hash_equal(const unsigned char *a, const unsigned char *b, int hash_size)
+static int hash_equal(const unsigned char *a, const unsigned char *b, uint32_t hash_size)
{
if (a && b)
return !memcmp(a, b, hash_size);
@@ -1220,9 +1214,8 @@ static int hash_equal(const unsigned char *a, const unsigned char *b, int hash_s
}
int reftable_ref_record_equal(const struct reftable_ref_record *a,
- const struct reftable_ref_record *b, int hash_size)
+ const struct reftable_ref_record *b, uint32_t hash_size)
{
- assert(hash_size > 0);
if (!null_streq(a->refname, b->refname))
return 0;
diff --git a/reftable/record.h b/reftable/record.h
index 25aa908c85..c7755a4d75 100644
--- a/reftable/record.h
+++ b/reftable/record.h
@@ -32,8 +32,10 @@ static inline void string_view_consume(struct string_view *s, int n)
s->len -= n;
}
-/* utilities for de/encoding varints */
-
+/*
+ * Decode and encode a varint. Returns the number of bytes read/written, or a
+ * negative value in case encoding/decoding the varint has failed.
+ */
int get_var_int(uint64_t *dest, struct string_view *in);
int put_var_int(struct string_view *dest, uint64_t val);
@@ -45,18 +47,18 @@ struct reftable_record_vtable {
/* The record type of ('r' for ref). */
uint8_t type;
- int (*copy_from)(void *dest, const void *src, int hash_size);
+ int (*copy_from)(void *dest, const void *src, uint32_t hash_size);
/* a value of [0..7], indicating record subvariants (eg. ref vs. symref
* vs ref deletion) */
uint8_t (*val_type)(const void *rec);
/* encodes rec into dest, returning how much space was used. */
- int (*encode)(const void *rec, struct string_view dest, int hash_size);
+ int (*encode)(const void *rec, struct string_view dest, uint32_t hash_size);
/* decode data from `src` into the record. */
int (*decode)(void *rec, struct reftable_buf key, uint8_t extra,
- struct string_view src, int hash_size,
+ struct string_view src, uint32_t hash_size,
struct reftable_buf *scratch);
/* deallocate and null the record. */
@@ -66,16 +68,13 @@ struct reftable_record_vtable {
int (*is_deletion)(const void *rec);
/* Are two records equal? This assumes they have the same type. Returns 0 for non-equal. */
- int (*equal)(const void *a, const void *b, int hash_size);
+ int (*equal)(const void *a, const void *b, uint32_t hash_size);
/*
* Compare keys of two records with each other. The records must have
* the same type.
*/
int (*cmp)(const void *a, const void *b);
-
- /* Print on stdout, for debugging. */
- void (*print)(const void *rec, int hash_size);
};
/* returns true for recognized block types. Block start with the block type. */
@@ -136,16 +135,16 @@ void reftable_record_init(struct reftable_record *rec, uint8_t typ);
/* see struct record_vtable */
int reftable_record_cmp(struct reftable_record *a, struct reftable_record *b);
-int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, int hash_size);
+int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, uint32_t hash_size);
int reftable_record_key(struct reftable_record *rec, struct reftable_buf *dest);
int reftable_record_copy_from(struct reftable_record *rec,
- struct reftable_record *src, int hash_size);
+ struct reftable_record *src, uint32_t hash_size);
uint8_t reftable_record_val_type(struct reftable_record *rec);
int reftable_record_encode(struct reftable_record *rec, struct string_view dest,
- int hash_size);
+ uint32_t hash_size);
int reftable_record_decode(struct reftable_record *rec, struct reftable_buf key,
uint8_t extra, struct string_view src,
- int hash_size, struct reftable_buf *scratch);
+ uint32_t hash_size, struct reftable_buf *scratch);
int reftable_record_is_deletion(struct reftable_record *rec);
static inline uint8_t reftable_record_type(struct reftable_record *rec)
diff --git a/reftable/reftable-basics.h b/reftable/reftable-basics.h
index 6e8e636b71..e0397ed583 100644
--- a/reftable/reftable-basics.h
+++ b/reftable/reftable-basics.h
@@ -11,6 +11,19 @@
#include <stddef.h>
+/*
+ * Hash functions understood by the reftable library. Note that the values are
+ * arbitrary and somewhat random such that we can easily detect cases where the
+ * hash hasn't been properly set up.
+ */
+enum reftable_hash {
+ REFTABLE_HASH_SHA1 = 89,
+ REFTABLE_HASH_SHA256 = 247,
+};
+#define REFTABLE_HASH_SIZE_SHA1 20
+#define REFTABLE_HASH_SIZE_SHA256 32
+#define REFTABLE_HASH_SIZE_MAX REFTABLE_HASH_SIZE_SHA256
+
/* Overrides the functions to use for memory management. */
void reftable_set_alloc(void *(*malloc)(size_t),
void *(*realloc)(void *, size_t), void (*free)(void *));
diff --git a/reftable/reftable-blocksource.h b/reftable/reftable-blocksource.h
index 5aa3990a57..6b326aa5ea 100644
--- a/reftable/reftable-blocksource.h
+++ b/reftable/reftable-blocksource.h
@@ -22,7 +22,7 @@ struct reftable_block_source {
* so it can return itself into the pool. */
struct reftable_block {
uint8_t *data;
- int len;
+ size_t len;
struct reftable_block_source source;
};
@@ -31,10 +31,13 @@ struct reftable_block_source_vtable {
/* returns the size of a block source */
uint64_t (*size)(void *source);
- /* reads a segment from the block source. It is an error to read
- beyond the end of the block */
- int (*read_block)(void *source, struct reftable_block *dest,
- uint64_t off, uint32_t size);
+ /*
+ * Reads a segment from the block source. It is an error to read beyond
+ * the end of the block.
+ */
+ ssize_t (*read_block)(void *source, struct reftable_block *dest,
+ uint64_t off, uint32_t size);
+
/* mark the block as read; may return the data back to malloc */
void (*return_block)(void *source, struct reftable_block *blockp);
diff --git a/reftable/reftable-merged.h b/reftable/reftable-merged.h
index a970d5dd89..f2d01c3ef8 100644
--- a/reftable/reftable-merged.h
+++ b/reftable/reftable-merged.h
@@ -34,7 +34,7 @@ struct reftable_reader;
*/
int reftable_merged_table_new(struct reftable_merged_table **dest,
struct reftable_reader **readers, size_t n,
- uint32_t hash_id);
+ enum reftable_hash hash_id);
/* Initialize a merged table iterator for reading refs. */
int reftable_merged_table_init_ref_iterator(struct reftable_merged_table *mt,
@@ -56,6 +56,6 @@ reftable_merged_table_min_update_index(struct reftable_merged_table *mt);
void reftable_merged_table_free(struct reftable_merged_table *m);
/* return the hash ID of the merged table. */
-uint32_t reftable_merged_table_hash_id(struct reftable_merged_table *m);
+enum reftable_hash reftable_merged_table_hash_id(struct reftable_merged_table *m);
#endif
diff --git a/reftable/reftable-reader.h b/reftable/reftable-reader.h
index 6a2d0b693f..0085fbb903 100644
--- a/reftable/reftable-reader.h
+++ b/reftable/reftable-reader.h
@@ -54,7 +54,7 @@ int reftable_reader_init_log_iterator(struct reftable_reader *r,
struct reftable_iterator *it);
/* returns the hash ID used in this table. */
-uint32_t reftable_reader_hash_id(struct reftable_reader *r);
+enum reftable_hash reftable_reader_hash_id(struct reftable_reader *r);
/* return an iterator for the refs pointing to `oid`. */
int reftable_reader_refs_for(struct reftable_reader *r,
diff --git a/reftable/reftable-record.h b/reftable/reftable-record.h
index 2d42463c58..931e594744 100644
--- a/reftable/reftable-record.h
+++ b/reftable/reftable-record.h
@@ -9,7 +9,7 @@ https://developers.google.com/open-source/licenses/bsd
#ifndef REFTABLE_RECORD_H
#define REFTABLE_RECORD_H
-#include "hash.h"
+#include "reftable-basics.h"
#include <stdint.h>
/*
@@ -40,10 +40,10 @@ struct reftable_ref_record {
#define REFTABLE_NR_REF_VALUETYPES 4
} value_type;
union {
- unsigned char val1[GIT_MAX_RAWSZ];
+ unsigned char val1[REFTABLE_HASH_SIZE_MAX];
struct {
- unsigned char value[GIT_MAX_RAWSZ]; /* first hash */
- unsigned char target_value[GIT_MAX_RAWSZ]; /* second hash */
+ unsigned char value[REFTABLE_HASH_SIZE_MAX]; /* first hash */
+ unsigned char target_value[REFTABLE_HASH_SIZE_MAX]; /* second hash */
} val2;
char *symref; /* referent, malloced 0-terminated string */
} value;
@@ -65,7 +65,7 @@ void reftable_ref_record_release(struct reftable_ref_record *ref);
/* returns whether two reftable_ref_records are the same. Useful for testing. */
int reftable_ref_record_equal(const struct reftable_ref_record *a,
- const struct reftable_ref_record *b, int hash_size);
+ const struct reftable_ref_record *b, uint32_t hash_size);
/* reftable_log_record holds a reflog entry */
struct reftable_log_record {
@@ -85,8 +85,8 @@ struct reftable_log_record {
union {
struct {
- unsigned char new_hash[GIT_MAX_RAWSZ];
- unsigned char old_hash[GIT_MAX_RAWSZ];
+ unsigned char new_hash[REFTABLE_HASH_SIZE_MAX];
+ unsigned char old_hash[REFTABLE_HASH_SIZE_MAX];
char *name;
char *email;
uint64_t time;
@@ -105,6 +105,6 @@ void reftable_log_record_release(struct reftable_log_record *log);
/* returns whether two records are equal. Useful for testing. */
int reftable_log_record_equal(const struct reftable_log_record *a,
- const struct reftable_log_record *b, int hash_size);
+ const struct reftable_log_record *b, uint32_t hash_size);
#endif
diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h
index 54787f2ef5..ae14270ea7 100644
--- a/reftable/reftable-stack.h
+++ b/reftable/reftable-stack.h
@@ -149,4 +149,7 @@ struct reftable_compaction_stats {
struct reftable_compaction_stats *
reftable_stack_compaction_stats(struct reftable_stack *st);
+/* Return the hash of the stack. */
+enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st);
+
#endif
diff --git a/reftable/reftable-writer.h b/reftable/reftable-writer.h
index e4fc953788..bfef3b1721 100644
--- a/reftable/reftable-writer.h
+++ b/reftable/reftable-writer.h
@@ -33,7 +33,7 @@ struct reftable_write_options {
/* 4-byte identifier ("sha1", "s256") of the hash.
* Defaults to SHA1 if unset
*/
- uint32_t hash_id;
+ enum reftable_hash hash_id;
/* Default mode for creating files. If unset, use 0666 (+umask) */
unsigned int default_permissions;
@@ -62,6 +62,21 @@ struct reftable_write_options {
* negative value will cause us to block indefinitely.
*/
long lock_timeout_ms;
+
+ /*
+ * Optional callback used to fsync files to disk. Falls back to using
+ * fsync(3P) when unset.
+ */
+ int (*fsync)(int fd);
+
+ /*
+ * Callback function to execute whenever the stack is being reloaded.
+ * This can be used e.g. to discard cached information that relies on
+ * the old stack's data. The payload data will be passed as argument to
+ * the callback.
+ */
+ void (*on_reload)(void *payload);
+ void *on_reload_payload;
};
/* reftable_block_stats holds statistics for a single block type */
@@ -69,7 +84,7 @@ struct reftable_block_stats {
/* total number of entries written */
int entries;
/* total number of key restarts */
- int restarts;
+ uint32_t restarts;
/* total number of blocks */
int blocks;
/* total number of index blocks */
diff --git a/reftable/stack.c b/reftable/stack.c
index c33979536e..f7c1845e15 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -8,7 +8,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "stack.h"
-#include "../write-or-die.h"
#include "system.h"
#include "constants.h"
#include "merged.h"
@@ -17,7 +16,6 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable-record.h"
#include "reftable-merged.h"
#include "writer.h"
-#include "tempfile.h"
static int stack_try_add(struct reftable_stack *st,
int (*write_table)(struct reftable_writer *wr,
@@ -43,17 +41,28 @@ static int stack_filename(struct reftable_buf *dest, struct reftable_stack *st,
return 0;
}
-static ssize_t reftable_fd_write(void *arg, const void *data, size_t sz)
+static int stack_fsync(const struct reftable_write_options *opts, int fd)
{
- int *fdp = (int *)arg;
- return write_in_full(*fdp, data, sz);
+ if (opts->fsync)
+ return opts->fsync(fd);
+ return fsync(fd);
}
-static int reftable_fd_flush(void *arg)
+struct fd_writer {
+ const struct reftable_write_options *opts;
+ int fd;
+};
+
+static ssize_t fd_writer_write(void *arg, const void *data, size_t sz)
{
- int *fdp = (int *)arg;
+ struct fd_writer *writer = arg;
+ return write_in_full(writer->fd, data, sz);
+}
- return fsync_component(FSYNC_COMPONENT_REFERENCE, *fdp);
+static int fd_writer_flush(void *arg)
+{
+ struct fd_writer *writer = arg;
+ return stack_fsync(writer->opts, writer->fd);
}
int reftable_new_stack(struct reftable_stack **dest, const char *dir,
@@ -73,7 +82,7 @@ int reftable_new_stack(struct reftable_stack **dest, const char *dir,
if (_opts)
opts = *_opts;
if (opts.hash_id == 0)
- opts.hash_id = GIT_SHA1_FORMAT_ID;
+ opts.hash_id = REFTABLE_HASH_SHA1;
*dest = NULL;
@@ -211,9 +220,9 @@ void reftable_stack_destroy(struct reftable_stack *st)
}
if (st->readers) {
- int i = 0;
struct reftable_buf filename = REFTABLE_BUF_INIT;
- for (i = 0; i < st->readers_len; i++) {
+
+ for (size_t i = 0; i < st->readers_len; i++) {
const char *name = reader_name(st->readers[i]);
int try_unlinking = 1;
@@ -229,6 +238,7 @@ void reftable_stack_destroy(struct reftable_stack *st)
unlink(filename.buf);
}
}
+
reftable_buf_release(&filename);
st->readers_len = 0;
REFTABLE_FREE_AND_NULL(st->readers);
@@ -261,9 +271,9 @@ static int reftable_stack_reload_once(struct reftable_stack *st,
int reuse_open)
{
size_t cur_len = !st->merged ? 0 : st->merged->readers_len;
- struct reftable_reader **cur;
+ struct reftable_reader **cur = NULL;
struct reftable_reader **reused = NULL;
- struct reftable_reader **new_readers;
+ struct reftable_reader **new_readers = NULL;
size_t reused_len = 0, reused_alloc = 0, names_len;
size_t new_readers_len = 0;
struct reftable_merged_table *new_merged = NULL;
@@ -271,18 +281,22 @@ static int reftable_stack_reload_once(struct reftable_stack *st,
int err = 0;
size_t i;
- cur = stack_copy_readers(st, cur_len);
- if (!cur) {
- err = REFTABLE_OUT_OF_MEMORY_ERROR;
- goto done;
+ if (cur_len) {
+ cur = stack_copy_readers(st, cur_len);
+ if (!cur) {
+ err = REFTABLE_OUT_OF_MEMORY_ERROR;
+ goto done;
+ }
}
names_len = names_length(names);
- new_readers = reftable_calloc(names_len, sizeof(*new_readers));
- if (!new_readers) {
- err = REFTABLE_OUT_OF_MEMORY_ERROR;
- goto done;
+ if (names_len) {
+ new_readers = reftable_calloc(names_len, sizeof(*new_readers));
+ if (!new_readers) {
+ err = REFTABLE_OUT_OF_MEMORY_ERROR;
+ goto done;
+ }
}
while (*names) {
@@ -304,7 +318,9 @@ static int reftable_stack_reload_once(struct reftable_stack *st,
* thus need to keep them alive here, which we
* do by bumping their refcount.
*/
- REFTABLE_ALLOC_GROW(reused, reused_len + 1, reused_alloc);
+ REFTABLE_ALLOC_GROW_OR_NULL(reused,
+ reused_len + 1,
+ reused_alloc);
if (!reused) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
@@ -478,7 +494,7 @@ static int reftable_stack_reload_maybe_reuse(struct reftable_stack *st,
close(fd);
fd = -1;
- delay = delay + (delay * rand()) / RAND_MAX + 1;
+ delay = delay + (delay * git_rand(CSPRNG_BYTES_INSECURE)) / UINT32_MAX + 1;
sleep_millisec(delay);
}
@@ -539,6 +555,10 @@ out:
close(fd);
free_names(names);
free_names(names_after);
+
+ if (st->opts.on_reload)
+ st->opts.on_reload(st->opts.on_reload_payload);
+
return err;
}
@@ -549,7 +569,6 @@ static int stack_uptodate(struct reftable_stack *st)
{
char **names = NULL;
int err;
- int i = 0;
/*
* When we have cached stat information available then we use it to
@@ -589,7 +608,7 @@ static int stack_uptodate(struct reftable_stack *st)
if (err < 0)
return err;
- for (i = 0; i < st->readers_len; i++) {
+ for (size_t i = 0; i < st->readers_len; i++) {
if (!names[i]) {
err = 1;
goto done;
@@ -640,7 +659,7 @@ int reftable_stack_add(struct reftable_stack *st,
static int format_name(struct reftable_buf *dest, uint64_t min, uint64_t max)
{
char buf[100];
- uint32_t rnd = (uint32_t)git_rand();
+ uint32_t rnd = git_rand(CSPRNG_BYTES_INSECURE);
snprintf(buf, sizeof(buf), "0x%012" PRIx64 "-0x%012" PRIx64 "-%08x",
min, max, rnd);
reftable_buf_reset(dest);
@@ -648,7 +667,7 @@ static int format_name(struct reftable_buf *dest, uint64_t min, uint64_t max)
}
struct reftable_addition {
- struct lock_file tables_list_lock;
+ struct reftable_flock tables_list_lock;
struct reftable_stack *stack;
char **new_tables;
@@ -667,10 +686,8 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
add->stack = st;
- err = hold_lock_file_for_update_timeout(&add->tables_list_lock,
- st->list_file,
- LOCK_NO_DEREF,
- st->opts.lock_timeout_ms);
+ err = flock_acquire(&add->tables_list_lock, st->list_file,
+ st->opts.lock_timeout_ms);
if (err < 0) {
if (errno == EEXIST) {
err = REFTABLE_LOCK_ERROR;
@@ -680,7 +697,7 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
goto done;
}
if (st->opts.default_permissions) {
- if (chmod(get_lock_file_path(&add->tables_list_lock),
+ if (chmod(add->tables_list_lock.path,
st->opts.default_permissions) < 0) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -724,7 +741,7 @@ static void reftable_addition_close(struct reftable_addition *add)
add->new_tables_len = 0;
add->new_tables_cap = 0;
- rollback_lock_file(&add->tables_list_lock);
+ flock_release(&add->tables_list_lock);
reftable_buf_release(&nm);
}
@@ -740,7 +757,6 @@ void reftable_addition_destroy(struct reftable_addition *add)
int reftable_addition_commit(struct reftable_addition *add)
{
struct reftable_buf table_list = REFTABLE_BUF_INIT;
- int lock_file_fd = get_lock_file_fd(&add->tables_list_lock);
int err = 0;
size_t i;
@@ -758,20 +774,20 @@ int reftable_addition_commit(struct reftable_addition *add)
goto done;
}
- err = write_in_full(lock_file_fd, table_list.buf, table_list.len);
+ err = write_in_full(add->tables_list_lock.fd, table_list.buf, table_list.len);
reftable_buf_release(&table_list);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
- err = fsync_component(FSYNC_COMPONENT_REFERENCE, lock_file_fd);
+ err = stack_fsync(&add->stack->opts, add->tables_list_lock.fd);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
- err = commit_lock_file(&add->tables_list_lock);
+ err = flock_commit(&add->tables_list_lock);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -857,9 +873,11 @@ int reftable_addition_add(struct reftable_addition *add,
struct reftable_buf tab_file_name = REFTABLE_BUF_INIT;
struct reftable_buf next_name = REFTABLE_BUF_INIT;
struct reftable_writer *wr = NULL;
- struct tempfile *tab_file = NULL;
+ struct reftable_tmpfile tab_file = REFTABLE_TMPFILE_INIT;
+ struct fd_writer writer = {
+ .opts = &add->stack->opts,
+ };
int err = 0;
- int tab_fd;
reftable_buf_reset(&next_name);
@@ -875,22 +893,20 @@ int reftable_addition_add(struct reftable_addition *add,
if (err < 0)
goto done;
- tab_file = mks_tempfile(temp_tab_file_name.buf);
- if (!tab_file) {
- err = REFTABLE_IO_ERROR;
+ err = tmpfile_from_pattern(&tab_file, temp_tab_file_name.buf);
+ if (err < 0)
goto done;
- }
if (add->stack->opts.default_permissions) {
- if (chmod(get_tempfile_path(tab_file),
+ if (chmod(tab_file.path,
add->stack->opts.default_permissions)) {
err = REFTABLE_IO_ERROR;
goto done;
}
}
- tab_fd = get_tempfile_fd(tab_file);
- err = reftable_writer_new(&wr, reftable_fd_write, reftable_fd_flush,
- &tab_fd, &add->stack->opts);
+ writer.fd = tab_file.fd;
+ err = reftable_writer_new(&wr, fd_writer_write, fd_writer_flush,
+ &writer, &add->stack->opts);
if (err < 0)
goto done;
@@ -906,11 +922,9 @@ int reftable_addition_add(struct reftable_addition *add,
if (err < 0)
goto done;
- err = close_tempfile_gently(tab_file);
- if (err < 0) {
- err = REFTABLE_IO_ERROR;
+ err = tmpfile_close(&tab_file);
+ if (err < 0)
goto done;
- }
if (wr->min_update_index < add->next_update_index) {
err = REFTABLE_API_ERROR;
@@ -933,14 +947,12 @@ int reftable_addition_add(struct reftable_addition *add,
On windows, this relies on rand() picking a unique destination name.
Maybe we should do retry loop as well?
*/
- err = rename_tempfile(&tab_file, tab_file_name.buf);
- if (err < 0) {
- err = REFTABLE_IO_ERROR;
+ err = tmpfile_rename(&tab_file, tab_file_name.buf);
+ if (err < 0)
goto done;
- }
- REFTABLE_ALLOC_GROW(add->new_tables, add->new_tables_len + 1,
- add->new_tables_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(add->new_tables, add->new_tables_len + 1,
+ add->new_tables_cap);
if (!add->new_tables) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
@@ -948,7 +960,7 @@ int reftable_addition_add(struct reftable_addition *add,
add->new_tables[add->new_tables_len++] = reftable_buf_detach(&next_name);
done:
- delete_tempfile(&tab_file);
+ tmpfile_delete(&tab_file);
reftable_buf_release(&temp_tab_file_name);
reftable_buf_release(&tab_file_name);
reftable_buf_release(&next_name);
@@ -968,13 +980,16 @@ uint64_t reftable_stack_next_update_index(struct reftable_stack *st)
static int stack_compact_locked(struct reftable_stack *st,
size_t first, size_t last,
struct reftable_log_expiry_config *config,
- struct tempfile **tab_file_out)
+ struct reftable_tmpfile *tab_file_out)
{
struct reftable_buf next_name = REFTABLE_BUF_INIT;
struct reftable_buf tab_file_path = REFTABLE_BUF_INIT;
struct reftable_writer *wr = NULL;
- struct tempfile *tab_file;
- int tab_fd, err = 0;
+ struct fd_writer writer= {
+ .opts = &st->opts,
+ };
+ struct reftable_tmpfile tab_file = REFTABLE_TMPFILE_INIT;
+ int err = 0;
err = format_name(&next_name, reftable_reader_min_update_index(st->readers[first]),
reftable_reader_max_update_index(st->readers[last]));
@@ -989,21 +1004,19 @@ static int stack_compact_locked(struct reftable_stack *st,
if (err < 0)
goto done;
- tab_file = mks_tempfile(tab_file_path.buf);
- if (!tab_file) {
- err = REFTABLE_IO_ERROR;
+ err = tmpfile_from_pattern(&tab_file, tab_file_path.buf);
+ if (err < 0)
goto done;
- }
- tab_fd = get_tempfile_fd(tab_file);
if (st->opts.default_permissions &&
- chmod(get_tempfile_path(tab_file), st->opts.default_permissions) < 0) {
+ chmod(tab_file.path, st->opts.default_permissions) < 0) {
err = REFTABLE_IO_ERROR;
goto done;
}
- err = reftable_writer_new(&wr, reftable_fd_write, reftable_fd_flush,
- &tab_fd, &st->opts);
+ writer.fd = tab_file.fd;
+ err = reftable_writer_new(&wr, fd_writer_write, fd_writer_flush,
+ &writer, &st->opts);
if (err < 0)
goto done;
@@ -1015,15 +1028,15 @@ static int stack_compact_locked(struct reftable_stack *st,
if (err < 0)
goto done;
- err = close_tempfile_gently(tab_file);
+ err = tmpfile_close(&tab_file);
if (err < 0)
goto done;
*tab_file_out = tab_file;
- tab_file = NULL;
+ tab_file = REFTABLE_TMPFILE_INIT;
done:
- delete_tempfile(&tab_file);
+ tmpfile_delete(&tab_file);
reftable_writer_free(wr);
reftable_buf_release(&next_name);
reftable_buf_release(&tab_file_path);
@@ -1154,9 +1167,9 @@ static int stack_compact_range(struct reftable_stack *st,
struct reftable_buf new_table_name = REFTABLE_BUF_INIT;
struct reftable_buf new_table_path = REFTABLE_BUF_INIT;
struct reftable_buf table_name = REFTABLE_BUF_INIT;
- struct lock_file tables_list_lock = LOCK_INIT;
- struct lock_file *table_locks = NULL;
- struct tempfile *new_table = NULL;
+ struct reftable_flock tables_list_lock = REFTABLE_FLOCK_INIT;
+ struct reftable_flock *table_locks = NULL;
+ struct reftable_tmpfile new_table = REFTABLE_TMPFILE_INIT;
int is_empty_table = 0, err = 0;
size_t first_to_replace, last_to_replace;
size_t i, nlocks = 0;
@@ -1173,10 +1186,7 @@ static int stack_compact_range(struct reftable_stack *st,
* Hold the lock so that we can read "tables.list" and lock all tables
* which are part of the user-specified range.
*/
- err = hold_lock_file_for_update_timeout(&tables_list_lock,
- st->list_file,
- LOCK_NO_DEREF,
- st->opts.lock_timeout_ms);
+ err = flock_acquire(&tables_list_lock, st->list_file, st->opts.lock_timeout_ms);
if (err < 0) {
if (errno == EEXIST)
err = REFTABLE_LOCK_ERROR;
@@ -1199,19 +1209,20 @@ static int stack_compact_range(struct reftable_stack *st,
* older process is still busy compacting tables which are preexisting
* from the point of view of the newer process.
*/
- REFTABLE_CALLOC_ARRAY(table_locks, last - first + 1);
+ REFTABLE_ALLOC_ARRAY(table_locks, last - first + 1);
if (!table_locks) {
err = REFTABLE_OUT_OF_MEMORY_ERROR;
goto done;
}
+ for (i = 0; i < last - first + 1; i++)
+ table_locks[i] = REFTABLE_FLOCK_INIT;
for (i = last + 1; i > first; i--) {
err = stack_filename(&table_name, st, reader_name(st->readers[i - 1]));
if (err < 0)
goto done;
- err = hold_lock_file_for_update(&table_locks[nlocks],
- table_name.buf, LOCK_NO_DEREF);
+ err = flock_acquire(&table_locks[nlocks], table_name.buf, 0);
if (err < 0) {
/*
* When the table is locked already we may do a
@@ -1247,7 +1258,7 @@ static int stack_compact_range(struct reftable_stack *st,
* run into file descriptor exhaustion when we compress a lot
* of tables.
*/
- err = close_lock_file_gently(&table_locks[nlocks++]);
+ err = flock_close(&table_locks[nlocks++]);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -1259,7 +1270,7 @@ static int stack_compact_range(struct reftable_stack *st,
* "tables.list" lock while compacting the locked tables. This allows
* concurrent updates to the stack to proceed.
*/
- err = rollback_lock_file(&tables_list_lock);
+ err = flock_release(&tables_list_lock);
if (err < 0) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -1282,10 +1293,7 @@ static int stack_compact_range(struct reftable_stack *st,
* "tables.list". We'll then replace the compacted range of tables with
* the new table.
*/
- err = hold_lock_file_for_update_timeout(&tables_list_lock,
- st->list_file,
- LOCK_NO_DEREF,
- st->opts.lock_timeout_ms);
+ err = flock_acquire(&tables_list_lock, st->list_file, st->opts.lock_timeout_ms);
if (err < 0) {
if (errno == EEXIST)
err = REFTABLE_LOCK_ERROR;
@@ -1295,7 +1303,7 @@ static int stack_compact_range(struct reftable_stack *st,
}
if (st->opts.default_permissions) {
- if (chmod(get_lock_file_path(&tables_list_lock),
+ if (chmod(tables_list_lock.path,
st->opts.default_permissions) < 0) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -1424,11 +1432,9 @@ static int stack_compact_range(struct reftable_stack *st,
if (err < 0)
goto done;
- err = rename_tempfile(&new_table, new_table_path.buf);
- if (err < 0) {
- err = REFTABLE_IO_ERROR;
+ err = tmpfile_rename(&new_table, new_table_path.buf);
+ if (err < 0)
goto done;
- }
}
/*
@@ -1452,7 +1458,7 @@ static int stack_compact_range(struct reftable_stack *st,
goto done;
}
- err = write_in_full(get_lock_file_fd(&tables_list_lock),
+ err = write_in_full(tables_list_lock.fd,
tables_list_buf.buf, tables_list_buf.len);
if (err < 0) {
err = REFTABLE_IO_ERROR;
@@ -1460,14 +1466,14 @@ static int stack_compact_range(struct reftable_stack *st,
goto done;
}
- err = fsync_component(FSYNC_COMPONENT_REFERENCE, get_lock_file_fd(&tables_list_lock));
+ err = stack_fsync(&st->opts, tables_list_lock.fd);
if (err < 0) {
err = REFTABLE_IO_ERROR;
unlink(new_table_path.buf);
goto done;
}
- err = commit_lock_file(&tables_list_lock);
+ err = flock_commit(&tables_list_lock);
if (err < 0) {
err = REFTABLE_IO_ERROR;
unlink(new_table_path.buf);
@@ -1488,19 +1494,24 @@ static int stack_compact_range(struct reftable_stack *st,
* readers, so it is expected that unlinking tables may fail.
*/
for (i = 0; i < nlocks; i++) {
- struct lock_file *table_lock = &table_locks[i];
- char *table_path = get_locked_file_path(table_lock);
- unlink(table_path);
- reftable_free(table_path);
+ struct reftable_flock *table_lock = &table_locks[i];
+
+ reftable_buf_reset(&table_name);
+ err = reftable_buf_add(&table_name, table_lock->path,
+ strlen(table_lock->path) - strlen(".lock"));
+ if (err)
+ continue;
+
+ unlink(table_name.buf);
}
done:
- rollback_lock_file(&tables_list_lock);
+ flock_release(&tables_list_lock);
for (i = 0; table_locks && i < nlocks; i++)
- rollback_lock_file(&table_locks[i]);
+ flock_release(&table_locks[i]);
reftable_free(table_locks);
- delete_tempfile(&new_table);
+ tmpfile_delete(&new_table);
reftable_buf_release(&new_table_name);
reftable_buf_release(&new_table_path);
reftable_buf_release(&tables_list_buf);
@@ -1603,7 +1614,7 @@ struct segment suggest_compaction_segment(uint64_t *sizes, size_t n,
static uint64_t *stack_table_sizes_for_compaction(struct reftable_stack *st)
{
- int version = (st->opts.hash_id == GIT_SHA1_FORMAT_ID) ? 1 : 2;
+ int version = (st->opts.hash_id == REFTABLE_HASH_SHA1) ? 1 : 2;
int overhead = header_size(version) - 1;
uint64_t *sizes;
@@ -1622,6 +1633,9 @@ int reftable_stack_auto_compact(struct reftable_stack *st)
struct segment seg;
uint64_t *sizes;
+ if (st->merged->readers_len < 2)
+ return 0;
+
sizes = stack_table_sizes_for_compaction(st);
if (!sizes)
return REFTABLE_OUT_OF_MEMORY_ERROR;
@@ -1753,14 +1767,12 @@ static int reftable_stack_clean_locked(struct reftable_stack *st)
}
while ((d = readdir(dir))) {
- int i = 0;
int found = 0;
if (!is_table_name(d->d_name))
continue;
- for (i = 0; !found && i < st->readers_len; i++) {
+ for (size_t i = 0; !found && i < st->readers_len; i++)
found = !strcmp(reader_name(st->readers[i]), d->d_name);
- }
if (found)
continue;
@@ -1790,3 +1802,8 @@ done:
reftable_addition_destroy(add);
return err;
}
+
+enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st)
+{
+ return reftable_merged_table_hash_id(st->merged);
+}
diff --git a/reftable/system.c b/reftable/system.c
new file mode 100644
index 0000000000..adf8e4d30b
--- /dev/null
+++ b/reftable/system.c
@@ -0,0 +1,126 @@
+#include "system.h"
+#include "basics.h"
+#include "reftable-error.h"
+#include "../lockfile.h"
+#include "../tempfile.h"
+
+int tmpfile_from_pattern(struct reftable_tmpfile *out, const char *pattern)
+{
+ struct tempfile *tempfile;
+
+ tempfile = mks_tempfile(pattern);
+ if (!tempfile)
+ return REFTABLE_IO_ERROR;
+
+ out->path = tempfile->filename.buf;
+ out->fd = tempfile->fd;
+ out->priv = tempfile;
+
+ return 0;
+}
+
+int tmpfile_close(struct reftable_tmpfile *t)
+{
+ struct tempfile *tempfile = t->priv;
+ int ret = close_tempfile_gently(tempfile);
+ t->fd = -1;
+ if (ret < 0)
+ return REFTABLE_IO_ERROR;
+ return 0;
+}
+
+int tmpfile_delete(struct reftable_tmpfile *t)
+{
+ struct tempfile *tempfile = t->priv;
+ int ret = delete_tempfile(&tempfile);
+ *t = REFTABLE_TMPFILE_INIT;
+ if (ret < 0)
+ return REFTABLE_IO_ERROR;
+ return 0;
+}
+
+int tmpfile_rename(struct reftable_tmpfile *t, const char *path)
+{
+ struct tempfile *tempfile = t->priv;
+ int ret = rename_tempfile(&tempfile, path);
+ *t = REFTABLE_TMPFILE_INIT;
+ if (ret < 0)
+ return REFTABLE_IO_ERROR;
+ return 0;
+}
+
+int flock_acquire(struct reftable_flock *l, const char *target_path,
+ long timeout_ms)
+{
+ struct lock_file *lockfile;
+ int err;
+
+ lockfile = reftable_malloc(sizeof(*lockfile));
+ if (!lockfile)
+ return REFTABLE_OUT_OF_MEMORY_ERROR;
+
+ err = hold_lock_file_for_update_timeout(lockfile, target_path, LOCK_NO_DEREF,
+ timeout_ms);
+ if (err < 0) {
+ reftable_free(lockfile);
+ if (errno == EEXIST)
+ return REFTABLE_LOCK_ERROR;
+ return -1;
+ }
+
+ l->fd = get_lock_file_fd(lockfile);
+ l->path = get_lock_file_path(lockfile);
+ l->priv = lockfile;
+
+ return 0;
+}
+
+int flock_close(struct reftable_flock *l)
+{
+ struct lock_file *lockfile = l->priv;
+ int ret;
+
+ if (!lockfile)
+ return REFTABLE_API_ERROR;
+
+ ret = close_lock_file_gently(lockfile);
+ l->fd = -1;
+ if (ret < 0)
+ return REFTABLE_IO_ERROR;
+
+ return 0;
+}
+
+int flock_release(struct reftable_flock *l)
+{
+ struct lock_file *lockfile = l->priv;
+ int ret;
+
+ if (!lockfile)
+ return 0;
+
+ ret = rollback_lock_file(lockfile);
+ reftable_free(lockfile);
+ *l = REFTABLE_FLOCK_INIT;
+ if (ret < 0)
+ return REFTABLE_IO_ERROR;
+
+ return 0;
+}
+
+int flock_commit(struct reftable_flock *l)
+{
+ struct lock_file *lockfile = l->priv;
+ int ret;
+
+ if (!lockfile)
+ return REFTABLE_API_ERROR;
+
+ ret = commit_lock_file(lockfile);
+ reftable_free(lockfile);
+ *l = REFTABLE_FLOCK_INIT;
+ if (ret < 0)
+ return REFTABLE_IO_ERROR;
+
+ return 0;
+}
diff --git a/reftable/system.h b/reftable/system.h
index 5ec8583343..7d5f803eeb 100644
--- a/reftable/system.h
+++ b/reftable/system.h
@@ -12,11 +12,90 @@ https://developers.google.com/open-source/licenses/bsd
/* This header glues the reftable library to the rest of Git */
#include "git-compat-util.h"
-#include "lockfile.h"
-#include "tempfile.h"
-#include "hash.h" /* hash ID, sizes.*/
-#include "dir.h" /* remove_dir_recursively, for tests.*/
-int hash_size(uint32_t id);
+/*
+ * An implementation-specific temporary file. By making this specific to the
+ * implementation it becomes possible to tie temporary files into any kind of
+ * signal or atexit handlers for cleanup on abnormal situations.
+ */
+struct reftable_tmpfile {
+ const char *path;
+ int fd;
+ void *priv;
+};
+#define REFTABLE_TMPFILE_INIT ((struct reftable_tmpfile) { .fd = -1, })
+
+/*
+ * Create a temporary file from a pattern similar to how mkstemp(3p) would.
+ * The `pattern` shall not be modified. On success, the structure at `out` has
+ * been initialized such that it is ready for use. Returns 0 on success, a
+ * reftable error code on error.
+ */
+int tmpfile_from_pattern(struct reftable_tmpfile *out, const char *pattern);
+
+/*
+ * Close the temporary file's file descriptor without removing the file itself.
+ * This is a no-op in case the file has already been closed beforehand. Returns
+ * 0 on success, a reftable error code on error.
+ */
+int tmpfile_close(struct reftable_tmpfile *t);
+
+/*
+ * Close the temporary file and delete it. This is a no-op in case the file has
+ * already been deleted or renamed beforehand. Returns 0 on success, a reftable
+ * error code on error.
+ */
+int tmpfile_delete(struct reftable_tmpfile *t);
+
+/*
+ * Rename the temporary file to the provided path. The temporary file must be
+ * active. Return 0 on success, a reftable error code on error. Deactivates the
+ * temporary file.
+ */
+int tmpfile_rename(struct reftable_tmpfile *t, const char *path);
+
+/*
+ * An implementation-specific file lock. Same as with `reftable_tmpfile`,
+ * making this specific to the implementation makes it possible to tie this
+ * into signal or atexit handlers such that we know to clean up stale locks on
+ * abnormal exits.
+ */
+struct reftable_flock {
+ const char *path;
+ int fd;
+ void *priv;
+};
+#define REFTABLE_FLOCK_INIT ((struct reftable_flock){ .fd = -1, })
+
+/*
+ * Acquire the lock for the given target path by exclusively creating a file
+ * with ".lock" appended to it. If that lock exists, we wait up to `timeout_ms`
+ * to acquire the lock. If `timeout_ms` is 0 we don't wait, if it is negative
+ * we block indefinitely.
+ *
+ * Retrun 0 on success, a reftable error code on error.
+ */
+int flock_acquire(struct reftable_flock *l, const char *target_path,
+ long timeout_ms);
+
+/*
+ * Close the lockfile's file descriptor without removing the lock itself. This
+ * is a no-op in case the lockfile has already been closed beforehand. Returns
+ * 0 on success, a reftable error code on error.
+ */
+int flock_close(struct reftable_flock *l);
+
+/*
+ * Release the lock by unlinking the lockfile. This is a no-op in case the
+ * lockfile has already been released or committed beforehand. Returns 0 on
+ * success, a reftable error code on error.
+ */
+int flock_release(struct reftable_flock *l);
+
+/*
+ * Commit the lock by renaming the lockfile into place. Returns 0 on success, a
+ * reftable error code on error.
+ */
+int flock_commit(struct reftable_flock *l);
#endif
diff --git a/reftable/writer.c b/reftable/writer.c
index 0b88e5583b..91d6629486 100644
--- a/reftable/writer.c
+++ b/reftable/writer.c
@@ -79,7 +79,7 @@ static void options_set_defaults(struct reftable_write_options *opts)
}
if (opts->hash_id == 0) {
- opts->hash_id = GIT_SHA1_FORMAT_ID;
+ opts->hash_id = REFTABLE_HASH_SHA1;
}
if (opts->block_size == 0) {
opts->block_size = DEFAULT_BLOCK_SIZE;
@@ -88,7 +88,7 @@ static void options_set_defaults(struct reftable_write_options *opts)
static int writer_version(struct reftable_writer *w)
{
- return (w->opts.hash_id == 0 || w->opts.hash_id == GIT_SHA1_FORMAT_ID) ?
+ return (w->opts.hash_id == 0 || w->opts.hash_id == REFTABLE_HASH_SHA1) ?
1 :
2;
}
@@ -103,8 +103,22 @@ static int writer_write_header(struct reftable_writer *w, uint8_t *dest)
put_be64(dest + 8, w->min_update_index);
put_be64(dest + 16, w->max_update_index);
if (writer_version(w) == 2) {
- put_be32(dest + 24, w->opts.hash_id);
+ uint32_t hash_id;
+
+ switch (w->opts.hash_id) {
+ case REFTABLE_HASH_SHA1:
+ hash_id = REFTABLE_FORMAT_ID_SHA1;
+ break;
+ case REFTABLE_HASH_SHA256:
+ hash_id = REFTABLE_FORMAT_ID_SHA256;
+ break;
+ default:
+ return -1;
+ }
+
+ put_be32(dest + 24, hash_id);
}
+
return header_size(writer_version(w));
}
@@ -240,7 +254,8 @@ static int writer_index_hash(struct reftable_writer *w, struct reftable_buf *has
if (key->offset_len > 0 && key->offsets[key->offset_len - 1] == off)
return 0;
- REFTABLE_ALLOC_GROW(key->offsets, key->offset_len + 1, key->offset_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(key->offsets, key->offset_len + 1,
+ key->offset_cap);
if (!key->offsets)
return REFTABLE_OUT_OF_MEMORY_ERROR;
key->offsets[key->offset_len++] = off;
@@ -562,7 +577,7 @@ static int writer_finish_section(struct reftable_writer *w)
struct common_prefix_arg {
struct reftable_buf *last;
- int max;
+ size_t max;
};
static void update_common(void *void_arg, void *key)
@@ -570,10 +585,9 @@ static void update_common(void *void_arg, void *key)
struct common_prefix_arg *arg = void_arg;
struct obj_index_tree_node *entry = key;
if (arg->last) {
- int n = common_prefix_size(&entry->hash, arg->last);
- if (n > arg->max) {
+ size_t n = common_prefix_size(&entry->hash, arg->last);
+ if (n > arg->max)
arg->max = n;
- }
}
arg->last = &entry->hash;
}
@@ -806,7 +820,7 @@ static int writer_flush_nonempty_block(struct reftable_writer *w)
* Note that this also applies when flushing index blocks, in which
* case we will end up with a multi-level index.
*/
- REFTABLE_ALLOC_GROW(w->index, w->index_len + 1, w->index_cap);
+ REFTABLE_ALLOC_GROW_OR_NULL(w->index, w->index_len + 1, w->index_cap);
if (!w->index)
return REFTABLE_OUT_OF_MEMORY_ERROR;
diff --git a/remote-curl.c b/remote-curl.c
index 9a71e04301..1273507a96 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "git-curl-compat.h"
@@ -941,7 +942,7 @@ static int post_rpc(struct rpc_state *rpc, int stateless_connect, int flush_rece
do {
err = probe_rpc(rpc, &results);
if (err == HTTP_REAUTH)
- credential_fill(&http_auth, 0);
+ credential_fill(the_repository, &http_auth, 0);
} while (err == HTTP_REAUTH);
if (err != HTTP_OK)
return -1;
@@ -1063,7 +1064,7 @@ retry:
rpc->any_written = 0;
err = run_slot(slot, NULL);
if (err == HTTP_REAUTH && !large_request) {
- credential_fill(&http_auth, 0);
+ credential_fill(the_repository, &http_auth, 0);
curl_slist_free_all(headers);
goto retry;
}
diff --git a/remote.c b/remote.c
index 10104d11e3..0f6fba8562 100644
--- a/remote.c
+++ b/remote.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -514,6 +515,24 @@ static int handle_config(const char *key, const char *value,
} else if (!strcmp(subkey, "serveroption")) {
return parse_transport_option(key, value,
&remote->server_options);
+ } else if (!strcmp(subkey, "followremotehead")) {
+ const char *no_warn_branch;
+ if (!strcmp(value, "never"))
+ remote->follow_remote_head = FOLLOW_REMOTE_NEVER;
+ else if (!strcmp(value, "create"))
+ remote->follow_remote_head = FOLLOW_REMOTE_CREATE;
+ else if (!strcmp(value, "warn")) {
+ remote->follow_remote_head = FOLLOW_REMOTE_WARN;
+ remote->no_warn_branch = NULL;
+ } else if (skip_prefix(value, "warn-if-not-", &no_warn_branch)) {
+ remote->follow_remote_head = FOLLOW_REMOTE_WARN;
+ remote->no_warn_branch = no_warn_branch;
+ } else if (!strcmp(value, "always")) {
+ remote->follow_remote_head = FOLLOW_REMOTE_ALWAYS;
+ } else {
+ warning(_("unrecognized followRemoteHEAD value '%s' ignored"),
+ value);
+ }
}
return 0;
}
@@ -1516,7 +1535,7 @@ static struct ref **tail_ref(struct ref **head)
struct tips {
struct commit **tip;
- int nr, alloc;
+ size_t nr, alloc;
};
static void add_to_tips(struct tips *tips, const struct object_id *oid)
@@ -1583,7 +1602,7 @@ static void add_missing_tags(struct ref *src, struct ref **dst, struct ref ***ds
const int reachable_flag = 1;
struct commit_list *found_commits;
struct commit **src_commits;
- int nr_src_commits = 0, alloc_src_commits = 16;
+ size_t nr_src_commits = 0, alloc_src_commits = 16;
ALLOC_ARRAY(src_commits, alloc_src_commits);
for_each_string_list_item(item, &src_tag) {
@@ -2854,9 +2873,9 @@ void apply_push_cas(struct push_cas_option *cas,
struct remote_state *remote_state_new(void)
{
- struct remote_state *r = xmalloc(sizeof(*r));
+ struct remote_state *r;
- memset(r, 0, sizeof(*r));
+ CALLOC_ARRAY(r, 1);
hashmap_init(&r->remotes_hash, remotes_hash_cmp, NULL, 0);
hashmap_init(&r->branches_hash, branches_hash_cmp, NULL, 0);
diff --git a/remote.h b/remote.h
index a7e5c4e07c..bda10dd5c8 100644
--- a/remote.h
+++ b/remote.h
@@ -59,6 +59,13 @@ struct remote_state {
void remote_state_clear(struct remote_state *remote_state);
struct remote_state *remote_state_new(void);
+ enum follow_remote_head_settings {
+ FOLLOW_REMOTE_NEVER = -1,
+ FOLLOW_REMOTE_CREATE = 0,
+ FOLLOW_REMOTE_WARN = 1,
+ FOLLOW_REMOTE_ALWAYS = 2,
+ };
+
struct remote {
struct hashmap_entry ent;
@@ -107,6 +114,9 @@ struct remote {
char *http_proxy_authmethod;
struct string_list server_options;
+
+ enum follow_remote_head_settings follow_remote_head;
+ const char *no_warn_branch;
};
/**
diff --git a/repo-settings.c b/repo-settings.c
index 4699b4b365..9d16d5399e 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -3,6 +3,7 @@
#include "repo-settings.h"
#include "repository.h"
#include "midx.h"
+#include "pack-objects.h"
static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
int def)
@@ -26,6 +27,7 @@ void prepare_repo_settings(struct repository *r)
const char *strval;
int manyfiles;
int read_changed_paths;
+ unsigned long ulongval;
if (!r->gitdir)
BUG("Cannot add settings for uninitialized repository");
@@ -123,6 +125,22 @@ void prepare_repo_settings(struct repository *r)
* removed.
*/
r->settings.command_requires_full_index = 1;
+
+ if (!repo_config_get_ulong(r, "core.deltabasecachelimit", &ulongval))
+ r->settings.delta_base_cache_limit = ulongval;
+
+ if (!repo_config_get_ulong(r, "core.packedgitwindowsize", &ulongval)) {
+ int pgsz_x2 = getpagesize() * 2;
+
+ /* This value must be multiple of (pagesize * 2) */
+ ulongval /= pgsz_x2;
+ if (ulongval < 1)
+ ulongval = 1;
+ r->settings.packed_git_window_size = ulongval * pgsz_x2;
+ }
+
+ if (!repo_config_get_ulong(r, "core.packedgitlimit", &ulongval))
+ r->settings.packed_git_limit = ulongval;
}
enum log_refs_config repo_settings_get_log_all_ref_updates(struct repository *repo)
diff --git a/repo-settings.h b/repo-settings.h
index 51d6156a11..93ea0c3274 100644
--- a/repo-settings.h
+++ b/repo-settings.h
@@ -57,12 +57,19 @@ struct repo_settings {
int core_multi_pack_index;
int warn_ambiguous_refs; /* lazily loaded via accessor */
+
+ size_t delta_base_cache_limit;
+ size_t packed_git_window_size;
+ size_t packed_git_limit;
};
#define REPO_SETTINGS_INIT { \
.index_version = -1, \
.core_untracked_cache = UNTRACKED_CACHE_KEEP, \
.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE, \
.warn_ambiguous_refs = -1, \
+ .delta_base_cache_limit = DEFAULT_DELTA_BASE_CACHE_LIMIT, \
+ .packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE, \
+ .packed_git_limit = DEFAULT_PACKED_GIT_LIMIT, \
}
void prepare_repo_settings(struct repository *r);
diff --git a/repository.c b/repository.c
index f988b8ae68..1a6a62bbd0 100644
--- a/repository.c
+++ b/repository.c
@@ -283,6 +283,7 @@ int repo_init(struct repository *repo,
repo_set_compat_hash_algo(repo, format.compat_hash_algo);
repo_set_ref_storage_format(repo, format.ref_storage_format);
repo->repository_format_worktree_config = format.worktree_config;
+ repo->repository_format_relative_worktrees = format.relative_worktrees;
/* take ownership of format.partial_clone */
repo->repository_format_partial_clone = format.partial_clone;
diff --git a/repository.h b/repository.h
index 24a66a496a..c4c92b2ab9 100644
--- a/repository.h
+++ b/repository.h
@@ -150,6 +150,7 @@ struct repository {
/* Configurations */
int repository_format_worktree_config;
+ int repository_format_relative_worktrees;
/* Indicate if a repository has a different 'commondir' from 'gitdir' */
unsigned different_commondir:1;
diff --git a/rerere.c b/rerere.c
index d01e98bf65..e7fa6426b3 100644
--- a/rerere.c
+++ b/rerere.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
diff --git a/resolve-undo.c b/resolve-undo.c
index 8c9911affb..52c45e5a49 100644
--- a/resolve-undo.c
+++ b/resolve-undo.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "dir.h"
@@ -33,7 +33,8 @@ void record_resolve_undo(struct index_state *istate, struct cache_entry *ce)
ui->mode[stage - 1] = ce->ce_mode;
}
-void resolve_undo_write(struct strbuf *sb, struct string_list *resolve_undo)
+void resolve_undo_write(struct strbuf *sb, struct string_list *resolve_undo,
+ const struct git_hash_algo *algop)
{
struct string_list_item *item;
for_each_string_list_item(item, resolve_undo) {
@@ -49,18 +50,19 @@ void resolve_undo_write(struct strbuf *sb, struct string_list *resolve_undo)
for (i = 0; i < 3; i++) {
if (!ui->mode[i])
continue;
- strbuf_add(sb, ui->oid[i].hash, the_hash_algo->rawsz);
+ strbuf_add(sb, ui->oid[i].hash, algop->rawsz);
}
}
}
-struct string_list *resolve_undo_read(const char *data, unsigned long size)
+struct string_list *resolve_undo_read(const char *data, unsigned long size,
+ const struct git_hash_algo *algop)
{
struct string_list *resolve_undo;
size_t len;
char *endptr;
int i;
- const unsigned rawsz = the_hash_algo->rawsz;
+ const unsigned rawsz = algop->rawsz;
CALLOC_ARRAY(resolve_undo, 1);
resolve_undo->strdup_strings = 1;
@@ -95,8 +97,7 @@ struct string_list *resolve_undo_read(const char *data, unsigned long size)
continue;
if (size < rawsz)
goto error;
- oidread(&ui->oid[i], (const unsigned char *)data,
- the_repository->hash_algo);
+ oidread(&ui->oid[i], (const unsigned char *)data, algop);
size -= rawsz;
data += rawsz;
}
diff --git a/resolve-undo.h b/resolve-undo.h
index 89a3227262..7ed11a1c59 100644
--- a/resolve-undo.h
+++ b/resolve-undo.h
@@ -14,8 +14,10 @@ struct resolve_undo_info {
};
void record_resolve_undo(struct index_state *, struct cache_entry *);
-void resolve_undo_write(struct strbuf *, struct string_list *);
-struct string_list *resolve_undo_read(const char *, unsigned long);
+void resolve_undo_write(struct strbuf *, struct string_list *,
+ const struct git_hash_algo *algop);
+struct string_list *resolve_undo_read(const char *, unsigned long,
+ const struct git_hash_algo *algop);
void resolve_undo_clear_index(struct index_state *);
int unmerge_index_entry(struct index_state *, const char *, struct resolve_undo_info *, unsigned);
void unmerge_index(struct index_state *, const struct pathspec *, unsigned);
diff --git a/revision.c b/revision.c
index 347dabf7f9..474fa1e767 100644
--- a/revision.c
+++ b/revision.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
@@ -390,7 +391,8 @@ static struct object *get_reference(struct rev_info *revs, const char *name,
if (!object) {
if (revs->ignore_missing)
return NULL;
- if (revs->exclude_promisor_objects && is_promisor_object(oid))
+ if (revs->exclude_promisor_objects &&
+ is_promisor_object(revs->repo, oid))
return NULL;
if (revs->do_not_die_on_missing_objects) {
oidset_insert(&revs->missing_commits, oid);
@@ -432,7 +434,7 @@ static struct commit *handle_commit(struct rev_info *revs,
if (revs->ignore_missing_links || (flags & UNINTERESTING))
return NULL;
if (revs->exclude_promisor_objects &&
- is_promisor_object(&tag->tagged->oid))
+ is_promisor_object(revs->repo, &tag->tagged->oid))
return NULL;
if (revs->do_not_die_on_missing_objects && oid) {
oidset_insert(&revs->missing_commits, oid);
@@ -1211,7 +1213,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit,
revs->do_not_die_on_missing_objects;
if (repo_parse_commit_gently(revs->repo, p, gently) < 0) {
if (revs->exclude_promisor_objects &&
- is_promisor_object(&p->object.oid)) {
+ is_promisor_object(revs->repo, &p->object.oid)) {
if (revs->first_parent_only)
break;
continue;
@@ -3920,7 +3922,7 @@ int prepare_revision_walk(struct rev_info *revs)
revs->treesame.name = "treesame";
if (revs->exclude_promisor_objects) {
- for_each_packed_object(mark_uninteresting, revs,
+ for_each_packed_object(revs->repo, mark_uninteresting, revs,
FOR_EACH_OBJECT_PROMISOR_ONLY);
}
@@ -4108,10 +4110,10 @@ enum commit_action get_commit_action(struct rev_info *revs, struct commit *commi
{
if (commit->object.flags & SHOWN)
return commit_ignore;
- if (revs->unpacked && has_object_pack(&commit->object.oid))
+ if (revs->unpacked && has_object_pack(revs->repo, &commit->object.oid))
return commit_ignore;
if (revs->no_kept_objects) {
- if (has_object_kept_pack(&commit->object.oid,
+ if (has_object_kept_pack(revs->repo, &commit->object.oid,
revs->keep_pack_cache_flags))
return commit_ignore;
}
diff --git a/run-command.c b/run-command.c
index 94f2f3079f..402138b8b5 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "run-command.h"
diff --git a/scalar.c b/scalar.c
index ac0cb579d3..f24bcd0169 100644
--- a/scalar.c
+++ b/scalar.c
@@ -379,7 +379,7 @@ static int delete_enlistment(struct strbuf *enlistment)
offset = offset_1st_component(enlistment->buf);
path_sep = find_last_dir_sep(enlistment->buf + offset);
strbuf_add(&parent, enlistment->buf,
- path_sep ? path_sep - enlistment->buf : offset);
+ path_sep ? (size_t) (path_sep - enlistment->buf) : offset);
if (chdir(parent.buf) < 0) {
int res = error_errno(_("could not switch to '%s'"), parent.buf);
strbuf_release(&parent);
@@ -654,7 +654,7 @@ static int cmd_reconfigure(int argc, const char **argv)
NULL
};
struct string_list scalar_repos = STRING_LIST_INIT_DUP;
- int i, res = 0;
+ int res = 0;
struct strbuf commondir = STRBUF_INIT, gitdir = STRBUF_INIT;
argc = parse_options(argc, argv, NULL, options,
@@ -672,7 +672,7 @@ static int cmd_reconfigure(int argc, const char **argv)
git_config(get_scalar_repos, &scalar_repos);
- for (i = 0; i < scalar_repos.nr; i++) {
+ for (size_t i = 0; i < scalar_repos.nr; i++) {
int succeeded = 0;
struct repository *old_repo, r = { NULL };
const char *dir = scalar_repos.items[i].string;
diff --git a/send-pack.c b/send-pack.c
index 6677c44e8a..772c7683a0 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
@@ -44,10 +42,11 @@ int option_parse_push_signed(const struct option *opt,
die("bad %s argument: %s", opt->long_name, arg);
}
-static void feed_object(const struct object_id *oid, FILE *fh, int negative)
+static void feed_object(struct repository *r,
+ const struct object_id *oid, FILE *fh, int negative)
{
if (negative &&
- !repo_has_object_file_with_flags(the_repository, oid,
+ !repo_has_object_file_with_flags(r, oid,
OBJECT_INFO_SKIP_FETCH_OBJECT |
OBJECT_INFO_QUICK))
return;
@@ -61,7 +60,8 @@ static void feed_object(const struct object_id *oid, FILE *fh, int negative)
/*
* Make a pack stream and spit it out into file descriptor fd
*/
-static int pack_objects(int fd, struct ref *refs, struct oid_array *advertised,
+static int pack_objects(struct repository *r,
+ int fd, struct ref *refs, struct oid_array *advertised,
struct oid_array *negotiated,
struct send_pack_args *args)
{
@@ -72,10 +72,9 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *advertised,
*/
struct child_process po = CHILD_PROCESS_INIT;
FILE *po_in;
- int i;
int rc;
- trace2_region_enter("send_pack", "pack_objects", the_repository);
+ trace2_region_enter("send_pack", "pack_objects", r);
strvec_push(&po.args, "pack-objects");
strvec_push(&po.args, "--all-progress-implied");
strvec_push(&po.args, "--revs");
@@ -88,7 +87,7 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *advertised,
strvec_push(&po.args, "-q");
if (args->progress)
strvec_push(&po.args, "--progress");
- if (is_repository_shallow(the_repository))
+ if (is_repository_shallow(r))
strvec_push(&po.args, "--shallow");
if (args->disable_bitmaps)
strvec_push(&po.args, "--no-use-bitmap-index");
@@ -104,16 +103,16 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *advertised,
* parameters by writing to the pipe.
*/
po_in = xfdopen(po.in, "w");
- for (i = 0; i < advertised->nr; i++)
- feed_object(&advertised->oid[i], po_in, 1);
- for (i = 0; i < negotiated->nr; i++)
- feed_object(&negotiated->oid[i], po_in, 1);
+ for (size_t i = 0; i < advertised->nr; i++)
+ feed_object(r, &advertised->oid[i], po_in, 1);
+ for (size_t i = 0; i < negotiated->nr; i++)
+ feed_object(r, &negotiated->oid[i], po_in, 1);
while (refs) {
if (!is_null_oid(&refs->old_oid))
- feed_object(&refs->old_oid, po_in, 1);
+ feed_object(r, &refs->old_oid, po_in, 1);
if (!is_null_oid(&refs->new_oid))
- feed_object(&refs->new_oid, po_in, 0);
+ feed_object(r, &refs->new_oid, po_in, 0);
refs = refs->next;
}
@@ -147,10 +146,10 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *advertised,
*/
if (rc > 128 && rc != 141)
error("pack-objects died of signal %d", rc - 128);
- trace2_region_leave("send_pack", "pack_objects", the_repository);
+ trace2_region_leave("send_pack", "pack_objects", r);
return -1;
}
- trace2_region_leave("send_pack", "pack_objects", the_repository);
+ trace2_region_leave("send_pack", "pack_objects", r);
return 0;
}
@@ -165,7 +164,8 @@ static int receive_unpack_status(struct packet_reader *reader)
return 0;
}
-static int receive_status(struct packet_reader *reader, struct ref *refs)
+static int receive_status(struct repository *r,
+ struct packet_reader *reader, struct ref *refs)
{
struct ref *hint;
int ret;
@@ -173,7 +173,7 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
int new_report = 0;
int once = 0;
- trace2_region_enter("send_pack", "receive_status", the_repository);
+ trace2_region_enter("send_pack", "receive_status", r);
hint = NULL;
ret = receive_unpack_status(reader);
while (1) {
@@ -222,10 +222,10 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
if (!strcmp(key, "refname"))
report->ref_name = xstrdup_or_null(val);
else if (!strcmp(key, "old-oid") && val &&
- !parse_oid_hex(val, &old_oid, &val))
+ !parse_oid_hex_algop(val, &old_oid, &val, r->hash_algo))
report->old_oid = oiddup(&old_oid);
else if (!strcmp(key, "new-oid") && val &&
- !parse_oid_hex(val, &new_oid, &val))
+ !parse_oid_hex_algop(val, &new_oid, &val, r->hash_algo))
report->new_oid = oiddup(&new_oid);
else if (!strcmp(key, "forced-update"))
report->forced_update = 1;
@@ -272,7 +272,7 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
new_report = 1;
}
}
- trace2_region_leave("send_pack", "receive_status", the_repository);
+ trace2_region_leave("send_pack", "receive_status", r);
return ret;
}
@@ -294,9 +294,9 @@ static int advertise_shallow_grafts_cb(const struct commit_graft *graft, void *c
return 0;
}
-static void advertise_shallow_grafts_buf(struct strbuf *sb)
+static void advertise_shallow_grafts_buf(struct repository *r, struct strbuf *sb)
{
- if (!is_repository_shallow(the_repository))
+ if (!is_repository_shallow(r))
return;
for_each_commit_graft(advertise_shallow_grafts_cb, sb);
}
@@ -427,13 +427,14 @@ static void reject_invalid_nonce(const char *nonce, int len)
}
}
-static void get_commons_through_negotiation(const char *url,
+static void get_commons_through_negotiation(struct repository *r,
+ const char *url,
const struct ref *remote_refs,
struct oid_array *commons)
{
struct child_process child = CHILD_PROCESS_INIT;
const struct ref *ref;
- int len = the_hash_algo->hexsz + 1; /* hash + NL */
+ int len = r->hash_algo->hexsz + 1; /* hash + NL */
int nr_negotiation_tip = 0;
child.git_cmd = 1;
@@ -467,7 +468,7 @@ static void get_commons_through_negotiation(const char *url,
break;
if (read_len != len)
die("invalid length read %d", read_len);
- if (parse_oid_hex(hex_hash, &oid, &end) || *end != '\n')
+ if (parse_oid_hex_algop(hex_hash, &oid, &end, r->hash_algo) || *end != '\n')
die("invalid hash");
oid_array_append(commons, &oid);
} while (1);
@@ -481,7 +482,8 @@ static void get_commons_through_negotiation(const char *url,
}
}
-int send_pack(struct send_pack_args *args,
+int send_pack(struct repository *r,
+ struct send_pack_args *args,
int fd[], struct child_process *conn,
struct ref *remote_refs,
struct oid_array *extra_have)
@@ -519,17 +521,17 @@ int send_pack(struct send_pack_args *args,
goto out;
}
- git_config_get_bool("push.negotiate", &push_negotiate);
+ repo_config_get_bool(r, "push.negotiate", &push_negotiate);
if (push_negotiate) {
- trace2_region_enter("send_pack", "push_negotiate", the_repository);
- get_commons_through_negotiation(args->url, remote_refs, &commons);
- trace2_region_leave("send_pack", "push_negotiate", the_repository);
+ trace2_region_enter("send_pack", "push_negotiate", r);
+ get_commons_through_negotiation(r, args->url, remote_refs, &commons);
+ trace2_region_leave("send_pack", "push_negotiate", r);
}
- if (!git_config_get_bool("push.usebitmaps", &use_bitmaps))
+ if (!repo_config_get_bool(r, "push.usebitmaps", &use_bitmaps))
args->disable_bitmaps = !use_bitmaps;
- git_config_get_bool("transfer.advertisesid", &advertise_sid);
+ repo_config_get_bool(r, "transfer.advertisesid", &advertise_sid);
/* Does the other end support the reporting? */
if (server_supports("report-status-v2"))
@@ -555,7 +557,7 @@ int send_pack(struct send_pack_args *args,
if (server_supports("push-options"))
push_options_supported = 1;
- if (!server_supports_hash(the_hash_algo->name, &object_format_supported))
+ if (!server_supports_hash(r->hash_algo->name, &object_format_supported))
die(_("the receiving end does not support this repository's hash algorithm"));
if (args->push_cert != SEND_PACK_PUSH_CERT_NEVER) {
@@ -597,7 +599,7 @@ int send_pack(struct send_pack_args *args,
if (use_push_options)
strbuf_addstr(&cap_buf, " push-options");
if (object_format_supported)
- strbuf_addf(&cap_buf, " object-format=%s", the_hash_algo->name);
+ strbuf_addf(&cap_buf, " object-format=%s", r->hash_algo->name);
if (agent_supported)
strbuf_addf(&cap_buf, " agent=%s", git_user_agent_sanitized());
if (advertise_sid)
@@ -647,7 +649,7 @@ int send_pack(struct send_pack_args *args,
}
if (!args->dry_run)
- advertise_shallow_grafts_buf(&req_buf);
+ advertise_shallow_grafts_buf(r, &req_buf);
/*
* Finally, tell the other end!
@@ -687,7 +689,7 @@ int send_pack(struct send_pack_args *args,
}
if (args->stateless_rpc) {
- if (!args->dry_run && (cmds_sent || is_repository_shallow(the_repository))) {
+ if (!args->dry_run && (cmds_sent || is_repository_shallow(r))) {
packet_buf_flush(&req_buf);
send_sideband(out, -1, req_buf.buf, req_buf.len, LARGE_PACKET_MAX);
}
@@ -712,7 +714,7 @@ int send_pack(struct send_pack_args *args,
PACKET_READ_DIE_ON_ERR_PACKET);
if (need_pack_data && cmds_sent) {
- if (pack_objects(out, remote_refs, extra_have, &commons, args) < 0) {
+ if (pack_objects(r, out, remote_refs, extra_have, &commons, args) < 0) {
if (args->stateless_rpc)
close(out);
if (git_connection_is_socket(conn))
@@ -725,7 +727,7 @@ int send_pack(struct send_pack_args *args,
* we get one).
*/
if (status_report)
- receive_status(&reader, remote_refs);
+ receive_status(r, &reader, remote_refs);
if (use_sideband) {
close(demux.out);
@@ -744,7 +746,7 @@ int send_pack(struct send_pack_args *args,
packet_flush(out);
if (status_report && cmds_sent)
- ret = receive_status(&reader, remote_refs);
+ ret = receive_status(r, &reader, remote_refs);
else
ret = 0;
if (args->stateless_rpc)
diff --git a/send-pack.h b/send-pack.h
index 7edb80596c..d256715681 100644
--- a/send-pack.h
+++ b/send-pack.h
@@ -6,6 +6,7 @@
struct child_process;
struct oid_array;
struct ref;
+struct repository;
/* Possible values for push_cert field in send_pack_args. */
#define SEND_PACK_PUSH_CERT_NEVER 0
@@ -35,7 +36,7 @@ struct option;
int option_parse_push_signed(const struct option *opt,
const char *arg, int unset);
-int send_pack(struct send_pack_args *args,
+int send_pack(struct repository *r, struct send_pack_args *args,
int fd[], struct child_process *conn,
struct ref *remote_refs, struct oid_array *extra_have);
diff --git a/sequencer.c b/sequencer.c
index 459066e43b..407ee4e90f 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
diff --git a/serve.c b/serve.c
index d674764a25..f6dfe34a2b 100644
--- a/serve.c
+++ b/serve.c
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "git-compat-util.h"
#include "repository.h"
#include "config.h"
@@ -159,19 +157,18 @@ static struct protocol_capability capabilities[] = {
},
};
-void protocol_v2_advertise_capabilities(void)
+void protocol_v2_advertise_capabilities(struct repository *r)
{
struct strbuf capability = STRBUF_INIT;
struct strbuf value = STRBUF_INIT;
- int i;
/* serve by default supports v2 */
packet_write_fmt(1, "version 2\n");
- for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(capabilities); i++) {
struct protocol_capability *c = &capabilities[i];
- if (c->advertise(the_repository, &value)) {
+ if (c->advertise(r, &value)) {
strbuf_addstr(&capability, c->name);
if (value.len) {
@@ -194,12 +191,10 @@ void protocol_v2_advertise_capabilities(void)
static struct protocol_capability *get_capability(const char *key, const char **value)
{
- int i;
-
if (!key)
return NULL;
- for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(capabilities); i++) {
struct protocol_capability *c = &capabilities[i];
const char *out;
if (!skip_prefix(key, c->name, &out))
@@ -217,20 +212,20 @@ static struct protocol_capability *get_capability(const char *key, const char **
return NULL;
}
-static int receive_client_capability(const char *key)
+static int receive_client_capability(struct repository *r, const char *key)
{
const char *value;
const struct protocol_capability *c = get_capability(key, &value);
- if (!c || c->command || !c->advertise(the_repository, NULL))
+ if (!c || c->command || !c->advertise(r, NULL))
return 0;
if (c->receive)
- c->receive(the_repository, value);
+ c->receive(r, value);
return 1;
}
-static int parse_command(const char *key, struct protocol_capability **command)
+static int parse_command(struct repository *r, const char *key, struct protocol_capability **command)
{
const char *out;
@@ -241,7 +236,7 @@ static int parse_command(const char *key, struct protocol_capability **command)
if (*command)
die("command '%s' requested after already requesting command '%s'",
out, (*command)->name);
- if (!cmd || !cmd->advertise(the_repository, NULL) || !cmd->command || value)
+ if (!cmd || !cmd->advertise(r, NULL) || !cmd->command || value)
die("invalid command '%s'", out);
*command = cmd;
@@ -256,7 +251,7 @@ enum request_state {
PROCESS_REQUEST_DONE,
};
-static int process_request(void)
+static int process_request(struct repository *r)
{
enum request_state state = PROCESS_REQUEST_KEYS;
struct packet_reader reader;
@@ -281,8 +276,8 @@ static int process_request(void)
case PACKET_READ_EOF:
BUG("Should have already died when seeing EOF");
case PACKET_READ_NORMAL:
- if (parse_command(reader.line, &command) ||
- receive_client_capability(reader.line))
+ if (parse_command(r, reader.line, &command) ||
+ receive_client_capability(r, reader.line))
seen_capability_or_command = 1;
else
die("unknown capability '%s'", reader.line);
@@ -322,30 +317,30 @@ static int process_request(void)
if (!command)
die("no command requested");
- if (client_hash_algo != hash_algo_by_ptr(the_repository->hash_algo))
+ if (client_hash_algo != hash_algo_by_ptr(r->hash_algo))
die("mismatched object format: server %s; client %s",
- the_repository->hash_algo->name,
+ r->hash_algo->name,
hash_algos[client_hash_algo].name);
- command->command(the_repository, &reader);
+ command->command(r, &reader);
return 0;
}
-void protocol_v2_serve_loop(int stateless_rpc)
+void protocol_v2_serve_loop(struct repository *r, int stateless_rpc)
{
if (!stateless_rpc)
- protocol_v2_advertise_capabilities();
+ protocol_v2_advertise_capabilities(r);
/*
* If stateless-rpc was requested then exit after
* a single request/response exchange
*/
if (stateless_rpc) {
- process_request();
+ process_request(r);
} else {
for (;;)
- if (process_request())
+ if (process_request(r))
break;
}
}
diff --git a/serve.h b/serve.h
index f946cf904a..85bf73cfe5 100644
--- a/serve.h
+++ b/serve.h
@@ -1,7 +1,9 @@
#ifndef SERVE_H
#define SERVE_H
-void protocol_v2_advertise_capabilities(void);
-void protocol_v2_serve_loop(int stateless_rpc);
+struct repository;
+
+void protocol_v2_advertise_capabilities(struct repository *r);
+void protocol_v2_serve_loop(struct repository *r, int stateless_rpc);
#endif /* SERVE_H */
diff --git a/server-info.c b/server-info.c
index c5af4cd98a..31c3fdc118 100644
--- a/server-info.c
+++ b/server-info.c
@@ -1,4 +1,4 @@
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "dir.h"
@@ -17,6 +17,7 @@
#include "tempfile.h"
struct update_info_ctx {
+ struct repository *repo;
FILE *cur_fp;
FILE *old_fp; /* becomes NULL if it differs from cur_fp */
struct strbuf cur_sb;
@@ -72,7 +73,7 @@ static int uic_printf(struct update_info_ctx *uic, const char *fmt, ...)
* it into place. The contents of the file come from "generate", which
* should return non-zero if it encounters an error.
*/
-static int update_info_file(char *path,
+static int update_info_file(struct repository *r, char *path,
int (*generate)(struct update_info_ctx *),
int force)
{
@@ -80,6 +81,7 @@ static int update_info_file(char *path,
struct tempfile *f = NULL;
int ret = -1;
struct update_info_ctx uic = {
+ .repo = r,
.cur_fp = NULL,
.old_fp = NULL,
.cur_sb = STRBUF_INIT,
@@ -151,7 +153,7 @@ static int add_info_ref(const char *path, const char *referent UNUSED, const str
void *cb_data)
{
struct update_info_ctx *uic = cb_data;
- struct object *o = parse_object(the_repository, oid);
+ struct object *o = parse_object(uic->repo, oid);
if (!o)
return -1;
@@ -159,7 +161,7 @@ static int add_info_ref(const char *path, const char *referent UNUSED, const str
return -1;
if (o->type == OBJ_TAG) {
- o = deref_tag(the_repository, o, path, 0);
+ o = deref_tag(uic->repo, o, path, 0);
if (o)
if (uic_printf(uic, "%s %s^{}\n",
oid_to_hex(&o->oid), path) < 0)
@@ -170,14 +172,14 @@ static int add_info_ref(const char *path, const char *referent UNUSED, const str
static int generate_info_refs(struct update_info_ctx *uic)
{
- return refs_for_each_ref(get_main_ref_store(the_repository),
+ return refs_for_each_ref(get_main_ref_store(uic->repo),
add_info_ref, uic);
}
-static int update_info_refs(int force)
+static int update_info_refs(struct repository *r, int force)
{
- char *path = git_pathdup("info/refs");
- int ret = update_info_file(path, generate_info_refs, force);
+ char *path = repo_git_path(r, "info/refs");
+ int ret = update_info_file(r, path, generate_info_refs, force);
free(path);
return ret;
}
@@ -283,14 +285,14 @@ static int compare_info(const void *a_, const void *b_)
return 1;
}
-static void init_pack_info(const char *infofile, int force)
+static void init_pack_info(struct repository *r, const char *infofile, int force)
{
struct packed_git *p;
int stale;
int i;
size_t alloc = 0;
- for (p = get_all_packs(the_repository); p; p = p->next) {
+ for (p = get_all_packs(r); p; p = p->next) {
/* we ignore things on alternate path since they are
* not available to the pullers in general.
*/
@@ -339,33 +341,36 @@ static int write_pack_info_file(struct update_info_ctx *uic)
return 0;
}
-static int update_info_packs(int force)
+static int update_info_packs(struct repository *r, int force)
{
char *infofile = mkpathdup("%s/info/packs",
- repo_get_object_directory(the_repository));
+ repo_get_object_directory(r));
int ret;
- init_pack_info(infofile, force);
- ret = update_info_file(infofile, write_pack_info_file, force);
+ init_pack_info(r, infofile, force);
+ ret = update_info_file(r, infofile, write_pack_info_file, force);
free_pack_info();
free(infofile);
return ret;
}
/* public */
-int update_server_info(int force)
+int update_server_info(struct repository *r, int force)
{
/* We would add more dumb-server support files later,
* including index of available pack files and their
* intended audiences.
*/
int errs = 0;
+ char *path;
- errs = errs | update_info_refs(force);
- errs = errs | update_info_packs(force);
+ errs = errs | update_info_refs(r, force);
+ errs = errs | update_info_packs(r, force);
/* remove leftover rev-cache file if there is any */
- unlink_or_warn(git_path("info/rev-cache"));
+ path = repo_git_path(r, "info/rev-cache");
+ unlink_or_warn(path);
+ free(path);
return errs;
}
diff --git a/server-info.h b/server-info.h
index 13bbde2c55..e634d1722b 100644
--- a/server-info.h
+++ b/server-info.h
@@ -1,7 +1,9 @@
#ifndef SERVER_INFO_H
#define SERVER_INFO_H
+struct repository;
+
/* Dumb servers support */
-int update_server_info(int);
+int update_server_info(struct repository *r, int force);
#endif /* SERVER_INFO_H */
diff --git a/setup.c b/setup.c
index 7b648de027..8a488f3e7c 100644
--- a/setup.c
+++ b/setup.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -683,6 +684,9 @@ static enum extension_result handle_extension(const char *var,
"extensions.refstorage", value);
data->ref_storage_format = format;
return EXTENSION_OK;
+ } else if (!strcmp(ext, "relativeworktrees")) {
+ data->relative_worktrees = git_config_bool(var, value);
+ return EXTENSION_OK;
}
return EXTENSION_UNKNOWN;
}
@@ -1854,6 +1858,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
repo_fmt.ref_storage_format);
the_repository->repository_format_worktree_config =
repo_fmt.worktree_config;
+ the_repository->repository_format_relative_worktrees =
+ repo_fmt.relative_worktrees;
/* take ownership of repo_fmt.partial_clone */
the_repository->repository_format_partial_clone =
repo_fmt.partial_clone;
@@ -1950,6 +1956,8 @@ void check_repository_format(struct repository_format *fmt)
fmt->ref_storage_format);
the_repository->repository_format_worktree_config =
fmt->worktree_config;
+ the_repository->repository_format_relative_worktrees =
+ fmt->relative_worktrees;
the_repository->repository_format_partial_clone =
xstrdup_or_null(fmt->partial_clone);
clear_repository_format(&repo_fmt);
@@ -2204,8 +2212,8 @@ void initialize_repository_version(int hash_algo,
enum ref_storage_format ref_storage_format,
int reinit)
{
- char repo_version_string[10];
- int repo_version = GIT_REPO_VERSION;
+ struct strbuf repo_version = STRBUF_INIT;
+ int target_version = GIT_REPO_VERSION;
/*
* Note that we initialize the repository version to 1 when the ref
@@ -2216,12 +2224,7 @@ void initialize_repository_version(int hash_algo,
*/
if (hash_algo != GIT_HASH_SHA1 ||
ref_storage_format != REF_STORAGE_FORMAT_FILES)
- 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);
+ target_version = GIT_REPO_VERSION_READ;
if (hash_algo != GIT_HASH_SHA1 && hash_algo != GIT_HASH_UNKNOWN)
git_config_set("extensions.objectformat",
@@ -2234,6 +2237,25 @@ void initialize_repository_version(int hash_algo,
ref_storage_format_to_name(ref_storage_format));
else if (reinit)
git_config_set_gently("extensions.refstorage", NULL);
+
+ if (reinit) {
+ struct strbuf config = STRBUF_INIT;
+ struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
+
+ strbuf_git_common_path(&config, the_repository, "config");
+ read_repository_format(&repo_fmt, config.buf);
+
+ if (repo_fmt.v1_only_extensions.nr)
+ target_version = GIT_REPO_VERSION_READ;
+
+ strbuf_release(&config);
+ clear_repository_format(&repo_fmt);
+ }
+
+ strbuf_addf(&repo_version, "%d", target_version);
+ git_config_set("core.repositoryformatversion", repo_version.buf);
+
+ strbuf_release(&repo_version);
}
static int is_reinit(void)
@@ -2333,7 +2355,7 @@ static int create_default_files(const char *template_path,
adjust_shared_perm(repo_get_git_dir(the_repository));
}
- initialize_repository_version(fmt->hash_algo, fmt->ref_storage_format, 0);
+ initialize_repository_version(fmt->hash_algo, fmt->ref_storage_format, reinit);
/* Check filemode trustability */
path = git_path_buf(&buf, "config");
diff --git a/setup.h b/setup.h
index e496ab3e4d..18dc3b7368 100644
--- a/setup.h
+++ b/setup.h
@@ -129,6 +129,7 @@ struct repository_format {
int precious_objects;
char *partial_clone; /* value of extensions.partialclone */
int worktree_config;
+ int relative_worktrees;
int is_bare;
int hash_algo;
int compat_hash_algo;
diff --git a/shallow.c b/shallow.c
index 4bb1518dbc..b54244ffa9 100644
--- a/shallow.c
+++ b/shallow.c
@@ -133,7 +133,8 @@ static void free_depth_in_slab(int **ptr)
struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
int shallow_flag, int not_shallow_flag)
{
- int i = 0, cur_depth = 0;
+ size_t i = 0;
+ int cur_depth = 0;
struct commit_list *result = NULL;
struct object_array stack = OBJECT_ARRAY_INIT;
struct commit *commit = NULL;
@@ -334,16 +335,16 @@ static int write_shallow_commits_1(struct strbuf *out, int use_pack_protocol,
const struct oid_array *extra,
unsigned flags)
{
- struct write_shallow_data data;
- int i;
- data.out = out;
- data.use_pack_protocol = use_pack_protocol;
- data.count = 0;
- data.flags = flags;
+ struct write_shallow_data data = {
+ .out = out,
+ .use_pack_protocol = use_pack_protocol,
+ .flags = flags,
+ };
+
for_each_commit_graft(write_one_shallow, &data);
if (!extra)
return data.count;
- for (i = 0; i < extra->nr; i++) {
+ for (size_t i = 0; i < extra->nr; i++) {
strbuf_addstr(out, oid_to_hex(extra->oid + i));
strbuf_addch(out, '\n');
data.count++;
@@ -465,7 +466,6 @@ struct trace_key trace_shallow = TRACE_KEY_INIT(SHALLOW);
*/
void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
{
- int i;
trace_printf_key(&trace_shallow, "shallow: prepare_shallow_info\n");
memset(info, 0, sizeof(*info));
info->shallow = sa;
@@ -473,7 +473,7 @@ void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
return;
ALLOC_ARRAY(info->ours, sa->nr);
ALLOC_ARRAY(info->theirs, sa->nr);
- for (i = 0; i < sa->nr; i++) {
+ for (size_t i = 0; i < sa->nr; i++) {
if (repo_has_object_file(the_repository, sa->oid + i)) {
struct commit_graft *graft;
graft = lookup_commit_graft(the_repository,
@@ -506,7 +506,7 @@ void clear_shallow_info(struct shallow_info *info)
void remove_nonexistent_theirs_shallow(struct shallow_info *info)
{
struct object_id *oid = info->shallow->oid;
- int i, dst;
+ size_t i, dst;
trace_printf_key(&trace_shallow, "shallow: remove_nonexistent_theirs_shallow\n");
for (i = dst = 0; i < info->nr_theirs; i++) {
if (i != dst)
@@ -534,7 +534,7 @@ static uint32_t *paint_alloc(struct paint_info *info)
unsigned nr = DIV_ROUND_UP(info->nr_bits, 32);
unsigned size = nr * sizeof(uint32_t);
void *p;
- if (!info->pool_count || size > info->end - info->free) {
+ if (!info->pool_count || info->end < info->free + size) {
if (size > POOL_SIZE)
BUG("pool size too small for %d in paint_alloc()",
size);
@@ -559,7 +559,7 @@ static void paint_down(struct paint_info *info, const struct object_id *oid,
{
unsigned int i, nr;
struct commit_list *head = NULL;
- int bitmap_nr = DIV_ROUND_UP(info->nr_bits, 32);
+ size_t bitmap_nr = DIV_ROUND_UP(info->nr_bits, 32);
size_t bitmap_size = st_mult(sizeof(uint32_t), bitmap_nr);
struct commit *c = lookup_commit_reference_gently(the_repository, oid,
1);
@@ -659,7 +659,7 @@ void assign_shallow_commits_to_refs(struct shallow_info *info,
struct object_id *oid = info->shallow->oid;
struct oid_array *ref = info->ref;
unsigned int i, nr;
- int *shallow, nr_shallow = 0;
+ size_t *shallow, nr_shallow = 0;
struct paint_info pi;
trace_printf_key(&trace_shallow, "shallow: assign_shallow_commits_to_refs\n");
@@ -734,7 +734,7 @@ void assign_shallow_commits_to_refs(struct shallow_info *info,
struct commit_array {
struct commit **commits;
- int nr, alloc;
+ size_t nr, alloc;
};
static int add_ref(const char *refname UNUSED,
@@ -752,12 +752,11 @@ static int add_ref(const char *refname UNUSED,
return 0;
}
-static void update_refstatus(int *ref_status, int nr, uint32_t *bitmap)
+static void update_refstatus(int *ref_status, size_t nr, uint32_t *bitmap)
{
- unsigned int i;
if (!ref_status)
return;
- for (i = 0; i < nr; i++)
+ for (size_t i = 0; i < nr; i++)
if (bitmap[i / 32] & (1U << (i % 32)))
ref_status[i]++;
}
@@ -772,8 +771,8 @@ static void post_assign_shallow(struct shallow_info *info,
struct object_id *oid = info->shallow->oid;
struct commit *c;
uint32_t **bitmap;
- int dst, i, j;
- int bitmap_nr = DIV_ROUND_UP(info->ref->nr, 32);
+ size_t dst, i, j;
+ size_t bitmap_nr = DIV_ROUND_UP(info->ref->nr, 32);
struct commit_array ca;
trace_printf_key(&trace_shallow, "shallow: post_assign_shallow\n");
diff --git a/shallow.h b/shallow.h
index e9ca7e4bc8..9bfeade93e 100644
--- a/shallow.h
+++ b/shallow.h
@@ -59,8 +59,8 @@ void prune_shallow(unsigned options);
*/
struct shallow_info {
struct oid_array *shallow;
- int *ours, nr_ours;
- int *theirs, nr_theirs;
+ size_t *ours, nr_ours;
+ size_t *theirs, nr_theirs;
struct oid_array *ref;
/* for receive-pack */
@@ -69,7 +69,7 @@ struct shallow_info {
int *reachable;
int *shallow_ref;
struct commit **commits;
- int nr_commits;
+ size_t nr_commits;
};
void prepare_shallow_info(struct shallow_info *, struct oid_array *);
diff --git a/shared.mak b/shared.mak
index 29bebd30d8..1a99848a95 100644
--- a/shared.mak
+++ b/shared.mak
@@ -116,3 +116,14 @@ endef
define libpath_template
-L$(1) $(if $(filter-out -L,$(CC_LD_DYNPATH)),$(CC_LD_DYNPATH)$(1))
endef
+
+# Populate build information into a file via GIT-VERSION-GEN. Requires the
+# absolute path to the root source directory as well as input and output files
+# as arguments, in that order.
+define version_gen
+GIT_BUILT_FROM_COMMIT="$(GIT_BUILT_FROM_COMMIT)" \
+GIT_DATE="$(GIT_DATE)" \
+GIT_USER_AGENT="$(GIT_USER_AGENT)" \
+GIT_VERSION="$(GIT_VERSION_OVERRIDE)" \
+$(SHELL_PATH) "$(1)/GIT-VERSION-GEN" "$(1)" "$(2)" "$(3)"
+endef
diff --git a/sideband.c b/sideband.c
index 02805573fa..251e9615ed 100644
--- a/sideband.c
+++ b/sideband.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "color.h"
diff --git a/sparse-index.c b/sparse-index.c
index 2107840bfc..5634abafaa 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
diff --git a/split-index.c b/split-index.c
index cfbc773e6c..4c74c4adda 100644
--- a/split-index.c
+++ b/split-index.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/strbuf.c b/strbuf.c
index 3d2189a7f6..f30fdc6984 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex-ll.h"
@@ -495,7 +497,9 @@ void strbuf_add_percentencode(struct strbuf *dst, const char *src, int flags)
unsigned char ch = src[i];
if (ch <= 0x1F || ch >= 0x7F ||
(ch == '/' && (flags & STRBUF_ENCODE_SLASH)) ||
- strchr(URL_UNSAFE_CHARS, ch))
+ ((flags & STRBUF_ENCODE_HOST_AND_PORT) ?
+ !isalnum(ch) && !strchr("-.:[]", ch) :
+ !!strchr(URL_UNSAFE_CHARS, ch)))
strbuf_addf(dst, "%%%02X", (unsigned char)ch);
else
strbuf_addch(dst, ch);
diff --git a/strbuf.h b/strbuf.h
index 003f880ff7..6362777c0a 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -356,6 +356,7 @@ void strbuf_expand_bad_format(const char *format, const char *command);
void strbuf_addbuf_percentquote(struct strbuf *dst, const struct strbuf *src);
#define STRBUF_ENCODE_SLASH 1
+#define STRBUF_ENCODE_HOST_AND_PORT 2
/**
* Append the contents of a string to a strbuf, percent-encoding any characters
@@ -637,28 +638,6 @@ static inline void strbuf_complete_line(struct strbuf *sb)
strbuf_complete(sb, '\n');
}
-/*
- * Copy "name" to "sb", expanding any special @-marks as handled by
- * repo_interpret_branch_name(). The result is a non-qualified branch name
- * (so "foo" or "origin/master" instead of "refs/heads/foo" or
- * "refs/remotes/origin/master").
- *
- * Note that the resulting name may not be a syntactically valid refname.
- *
- * If "allowed" is non-zero, restrict the set of allowed expansions. See
- * repo_interpret_branch_name() for details.
- */
-void strbuf_branchname(struct strbuf *sb, const char *name,
- unsigned allowed);
-
-/*
- * Like strbuf_branchname() above, but confirm that the result is
- * syntactically valid to be used as a local branch name in refs/heads/.
- *
- * The return value is "0" if the result is valid, and "-1" otherwise.
- */
-int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
-
typedef int (*char_predicate)(char ch);
void strbuf_addstr_urlencode(struct strbuf *sb, const char *name,
diff --git a/string-list.c b/string-list.c
index 954569f381..bf061fec56 100644
--- a/string-list.c
+++ b/string-list.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "string-list.h"
diff --git a/strvec.c b/strvec.c
index d1cf4e2496..f8de79f557 100644
--- a/strvec.c
+++ b/strvec.c
@@ -61,16 +61,19 @@ void strvec_splice(struct strvec *array, size_t idx, size_t len,
{
if (idx + len > array->nr)
BUG("range outside of array boundary");
- if (replacement_len > len)
+ if (replacement_len > len) {
+ if (array->v == empty_strvec)
+ array->v = NULL;
ALLOC_GROW(array->v, array->nr + (replacement_len - len) + 1,
array->alloc);
+ array->v[array->nr + (replacement_len - len)] = NULL;
+ }
for (size_t i = 0; i < len; i++)
free((char *)array->v[idx + i]);
- if (replacement_len != len) {
+ if ((replacement_len != len) && array->nr)
memmove(array->v + idx + replacement_len, array->v + idx + len,
(array->nr - idx - len + 1) * sizeof(char *));
- array->nr += (replacement_len - len);
- }
+ array->nr += replacement_len - len;
for (size_t i = 0; i < replacement_len; i++)
array->v[idx + i] = xstrdup(replacement[i]);
}
@@ -127,8 +130,7 @@ void strvec_split(struct strvec *array, const char *to_split)
void strvec_clear(struct strvec *array)
{
if (array->v != empty_strvec) {
- int i;
- for (i = 0; i < array->nr; i++)
+ for (size_t i = 0; i < array->nr; i++)
free((char *)array->v[i]);
free(array->v);
}
diff --git a/submodule-config.c b/submodule-config.c
index 9c8c37b259..a25059ed7f 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "dir.h"
diff --git a/submodule.c b/submodule.c
index 7ec564854d..b361076c5b 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -1489,14 +1490,13 @@ struct fetch_task {
*/
static const struct submodule *get_non_gitmodules_submodule(const char *path)
{
- struct submodule *ret = NULL;
+ struct submodule *ret;
const char *name = default_name_or_path(path);
if (!name)
return NULL;
- ret = xmalloc(sizeof(*ret));
- memset(ret, 0, sizeof(*ret));
+ CALLOC_ARRAY(ret, 1);
ret->path = name;
ret->name = name;
@@ -1536,8 +1536,9 @@ static struct fetch_task *fetch_task_create(struct submodule_parallel_fetch *spf
const char *path,
const struct object_id *treeish_name)
{
- struct fetch_task *task = xmalloc(sizeof(*task));
- memset(task, 0, sizeof(*task));
+ struct fetch_task *task;
+
+ CALLOC_ARRAY(task, 1);
if (validate_submodule_path(path) < 0)
exit(128);
diff --git a/subprojects/.gitignore b/subprojects/.gitignore
new file mode 100644
index 0000000000..63ea916ef5
--- /dev/null
+++ b/subprojects/.gitignore
@@ -0,0 +1 @@
+/*/
diff --git a/subprojects/curl.wrap b/subprojects/curl.wrap
new file mode 100644
index 0000000000..f7e384b85c
--- /dev/null
+++ b/subprojects/curl.wrap
@@ -0,0 +1,13 @@
+[wrap-file]
+directory = curl-8.10.1
+source_url = https://github.com/curl/curl/releases/download/curl-8_10_1/curl-8.10.1.tar.xz
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/curl_8.10.1-1/curl-8.10.1.tar.xz
+source_filename = curl-8.10.1.tar.xz
+source_hash = 73a4b0e99596a09fa5924a4fb7e4b995a85fda0d18a2c02ab9cf134bebce04ee
+patch_filename = curl_8.10.1-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/curl_8.10.1-1/get_patch
+patch_hash = 707c28f35fc9b0e8d68c0c2800712007612f922a31da9637ce706a2159f3ddd8
+wrapdb_version = 8.10.1-1
+
+[provide]
+dependency_names = libcurl
diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap
new file mode 100644
index 0000000000..2e0427dcfd
--- /dev/null
+++ b/subprojects/expat.wrap
@@ -0,0 +1,13 @@
+[wrap-file]
+directory = expat-2.6.3
+source_url = https://github.com/libexpat/libexpat/releases/download/R_2_6_3/expat-2.6.3.tar.xz
+source_filename = expat-2.6.3.tar.bz2
+source_hash = 274db254a6979bde5aad404763a704956940e465843f2a9bd9ed7af22e2c0efc
+patch_filename = expat_2.6.3-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.6.3-1/get_patch
+patch_hash = cf017fbe105e31428b2768360bd9be39094df4e948a1e8d1c54b6f7c76460cb1
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/expat_2.6.3-1/expat-2.6.3.tar.bz2
+wrapdb_version = 2.6.3-1
+
+[provide]
+expat = expat_dep
diff --git a/subprojects/openssl.wrap b/subprojects/openssl.wrap
new file mode 100644
index 0000000000..873d55106e
--- /dev/null
+++ b/subprojects/openssl.wrap
@@ -0,0 +1,15 @@
+[wrap-file]
+directory = openssl-3.0.8
+source_url = https://www.openssl.org/source/openssl-3.0.8.tar.gz
+source_filename = openssl-3.0.8.tar.gz
+source_hash = 6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e
+patch_filename = openssl_3.0.8-3_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/openssl_3.0.8-3/get_patch
+patch_hash = 300da189e106942347d61a4a4295aa2edbcf06184f8d13b4cee0bed9fb936963
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/openssl_3.0.8-3/openssl-3.0.8.tar.gz
+wrapdb_version = 3.0.8-3
+
+[provide]
+libcrypto = libcrypto_dep
+libssl = libssl_dep
+openssl = openssl_dep
diff --git a/subprojects/pcre2.wrap b/subprojects/pcre2.wrap
new file mode 100644
index 0000000000..7e18447254
--- /dev/null
+++ b/subprojects/pcre2.wrap
@@ -0,0 +1,16 @@
+[wrap-file]
+directory = pcre2-10.44
+source_url = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.bz2
+source_filename = pcre2-10.44.tar.bz2
+source_hash = d34f02e113cf7193a1ebf2770d3ac527088d485d4e047ed10e5d217c6ef5de96
+patch_filename = pcre2_10.44-2_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/pcre2_10.44-2/get_patch
+patch_hash = 4336d422ee9043847e5e10dbbbd01940d4c9e5027f31ccdc33a7898a1ca94009
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/pcre2_10.44-2/pcre2-10.44.tar.bz2
+wrapdb_version = 10.44-2
+
+[provide]
+libpcre2-8 = libpcre2_8
+libpcre2-16 = libpcre2_16
+libpcre2-32 = libpcre2_32
+libpcre2-posix = libpcre2_posix
diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap
new file mode 100644
index 0000000000..aa14de1774
--- /dev/null
+++ b/subprojects/zlib.wrap
@@ -0,0 +1,13 @@
+[wrap-file]
+directory = zlib-1.3.1
+source_url = http://zlib.net/fossils/zlib-1.3.1.tar.gz
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3.1-1/zlib-1.3.1.tar.gz
+source_filename = zlib-1.3.1.tar.gz
+source_hash = 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
+patch_filename = zlib_1.3.1-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3.1-1/get_patch
+patch_hash = e79b98eb24a75392009cec6f99ca5cdca9881ff20bfa174e8b8926d5c7a47095
+wrapdb_version = 1.3.1-1
+
+[provide]
+zlib = zlib_dep
diff --git a/symlinks.c b/symlinks.c
index b29e340c2d..9cc090d42c 100644
--- a/symlinks.c
+++ b/symlinks.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "gettext.h"
#include "setup.h"
diff --git a/t/.gitignore b/t/.gitignore
index 91cf5772fe..3e6b0f2cc5 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -2,4 +2,5 @@
/test-results
/.prove
/chainlinttmp
+/mesontmp
/out/
diff --git a/t/Makefile b/t/Makefile
index 131ffd778f..daa5fcae86 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -59,7 +59,7 @@ CHAINLINTSUPPRESS = GIT_TEST_EXT_CHAIN_LINT=0 && export GIT_TEST_EXT_CHAIN_LINT
all:: $(DEFAULT_TEST_TARGET)
-test: pre-clean check-chainlint $(TEST_LINT)
+test: pre-clean check-chainlint check-meson $(TEST_LINT)
$(CHAINLINTSUPPRESS) $(MAKE) aggregate-results-and-cleanup
failed:
@@ -103,6 +103,7 @@ clean-except-prove-cache: clean-chainlint
clean: clean-except-prove-cache
$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
+ $(RM) -r mesontmp
$(RM) .prove
clean-chainlint:
@@ -114,6 +115,23 @@ check-chainlint:
{ $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests >'$(CHAINLINTTMP_SQ)'/actual || true; } && \
diff -u '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual
+check-meson:
+ @# awk acts up when trying to match single quotes, so we use \047 instead.
+ @mkdir -p mesontmp && \
+ printf "%s\n" \
+ "integration_tests t[0-9][0-9][0-9][0-9]-*.sh" \
+ "unit_test_programs unit-tests/t-*.c" \
+ "clar_test_suites unit-tests/u-*.c" | \
+ while read -r variable pattern; do \
+ awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build >mesontmp/meson.txt && \
+ ls $$pattern >mesontmp/actual.txt && \
+ if ! cmp mesontmp/meson.txt mesontmp/actual.txt; then \
+ echo "Meson tests differ from actual tests:"; \
+ diff -u mesontmp/meson.txt mesontmp/actual.txt; \
+ exit 1; \
+ fi; \
+ done
+
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
test-lint-filenames
ifneq ($(GIT_TEST_CHAIN_LINT),0)
diff --git a/t/helper/meson.build b/t/helper/meson.build
new file mode 100644
index 0000000000..f502d1aaa3
--- /dev/null
+++ b/t/helper/meson.build
@@ -0,0 +1,92 @@
+test_tool_sources = [
+ '../unit-tests/test-lib.c',
+ 'test-advise.c',
+ 'test-bitmap.c',
+ 'test-bloom.c',
+ 'test-bundle-uri.c',
+ 'test-cache-tree.c',
+ 'test-chmtime.c',
+ 'test-config.c',
+ 'test-crontab.c',
+ 'test-csprng.c',
+ 'test-date.c',
+ 'test-delete-gpgsig.c',
+ 'test-delta.c',
+ 'test-dir-iterator.c',
+ 'test-drop-caches.c',
+ 'test-dump-cache-tree.c',
+ 'test-dump-fsmonitor.c',
+ 'test-dump-split-index.c',
+ 'test-dump-untracked-cache.c',
+ 'test-env-helper.c',
+ 'test-example-tap.c',
+ 'test-find-pack.c',
+ 'test-fsmonitor-client.c',
+ 'test-genrandom.c',
+ 'test-genzeros.c',
+ 'test-getcwd.c',
+ 'test-hash-speed.c',
+ 'test-hash.c',
+ 'test-hashmap.c',
+ 'test-hexdump.c',
+ 'test-json-writer.c',
+ 'test-lazy-init-name-hash.c',
+ 'test-match-trees.c',
+ 'test-mergesort.c',
+ 'test-mktemp.c',
+ 'test-online-cpus.c',
+ 'test-pack-mtimes.c',
+ 'test-parse-options.c',
+ 'test-parse-pathspec-file.c',
+ 'test-partial-clone.c',
+ 'test-path-utils.c',
+ 'test-path-walk.c',
+ 'test-pcre2-config.c',
+ 'test-pkt-line.c',
+ 'test-proc-receive.c',
+ 'test-progress.c',
+ 'test-reach.c',
+ 'test-read-cache.c',
+ 'test-read-graph.c',
+ 'test-read-midx.c',
+ 'test-ref-store.c',
+ 'test-reftable.c',
+ 'test-regex.c',
+ 'test-repository.c',
+ 'test-revision-walking.c',
+ 'test-rot13-filter.c',
+ 'test-run-command.c',
+ 'test-scrap-cache-tree.c',
+ 'test-serve-v2.c',
+ 'test-sha1.c',
+ 'test-sha256.c',
+ 'test-sigchain.c',
+ 'test-simple-ipc.c',
+ 'test-string-list.c',
+ 'test-submodule-config.c',
+ 'test-submodule-nested-repo-config.c',
+ 'test-submodule.c',
+ 'test-subprocess.c',
+ 'test-tool.c',
+ 'test-trace2.c',
+ 'test-truncate.c',
+ 'test-userdiff.c',
+ 'test-wildmatch.c',
+ 'test-windows-named-pipe.c',
+ 'test-write-cache.c',
+ 'test-xml-encode.c',
+]
+
+test_tool = executable('test-tool',
+ sources: test_tool_sources,
+ dependencies: [libgit, common_main],
+)
+bin_wrappers += test_tool
+test_dependencies += test_tool
+
+test_fake_ssh = executable('test-fake-ssh',
+ sources: 'test-fake-ssh.c',
+ dependencies: [libgit, common_main],
+)
+bin_wrappers += test_fake_ssh
+test_dependencies += test_fake_ssh
diff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c
index 97541daf71..14e075c1a1 100644
--- a/t/helper/test-bloom.c
+++ b/t/helper/test-bloom.c
@@ -11,30 +11,25 @@ static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
static void add_string_to_filter(const char *data, struct bloom_filter *filter) {
struct bloom_key key;
- int i;
fill_bloom_key(data, strlen(data), &key, &settings);
printf("Hashes:");
- for (i = 0; i < settings.num_hashes; i++){
+ for (size_t i = 0; i < settings.num_hashes; i++)
printf("0x%08x|", key.hashes[i]);
- }
printf("\n");
add_key_to_filter(&key, filter, &settings);
clear_bloom_key(&key);
}
static void print_bloom_filter(struct bloom_filter *filter) {
- int i;
-
if (!filter) {
printf("No filter.\n");
return;
}
printf("Filter_Length:%d\n", (int)filter->len);
printf("Filter_Data:");
- for (i = 0; i < filter->len; i++) {
+ for (size_t i = 0; i < filter->len; i++)
printf("%02x|", filter->data[i]);
- }
printf("\n");
}
diff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c
index 5cdef3ebef..3ae45cec3b 100644
--- a/t/helper/test-cache-tree.c
+++ b/t/helper/test-cache-tree.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "test-tool.h"
#include "gettext.h"
diff --git a/t/helper/test-config.c b/t/helper/test-config.c
index 33247f0e92..75e028ab2a 100644
--- a/t/helper/test-config.c
+++ b/t/helper/test-config.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "test-tool.h"
#include "config.h"
diff --git a/t/helper/test-csprng.c b/t/helper/test-csprng.c
index 65d14973c5..c86dcc4870 100644
--- a/t/helper/test-csprng.c
+++ b/t/helper/test-csprng.c
@@ -1,7 +1,6 @@
#include "test-tool.h"
#include "git-compat-util.h"
-
int cmd__csprng(int argc, const char **argv)
{
unsigned long count;
@@ -12,11 +11,11 @@ int cmd__csprng(int argc, const char **argv)
return 2;
}
- count = (argc == 2) ? strtoul(argv[1], NULL, 0) : -1L;
+ count = (argc == 2) ? strtoul(argv[1], NULL, 0) : ULONG_MAX;
while (count) {
unsigned long chunk = count < sizeof(buf) ? count : sizeof(buf);
- if (csprng_bytes(buf, chunk) < 0) {
+ if (csprng_bytes(buf, chunk, 0) < 0) {
perror("failed to read");
return 5;
}
diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
index 73e551cfc2..7055d94354 100644
--- a/t/helper/test-drop-caches.c
+++ b/t/helper/test-drop-caches.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-tool.h"
#include "git-compat-util.h"
diff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c
index 1b7f37a84f..efd017ca35 100644
--- a/t/helper/test-dump-fsmonitor.c
+++ b/t/helper/test-dump-fsmonitor.c
@@ -8,7 +8,6 @@
int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
{
struct index_state *istate = the_repository->index;
- int i;
setup_git_directory();
if (do_read_index(istate, the_repository->index_file, 0) < 0)
@@ -19,7 +18,7 @@ int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
}
printf("fsmonitor last update %s\n", istate->fsmonitor_last_update);
- for (i = 0; i < istate->cache_nr; i++)
+ for (size_t i = 0; i < istate->cache_nr; i++)
printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
return 0;
diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c
index a6720faf9c..f855a3862c 100644
--- a/t/helper/test-dump-split-index.c
+++ b/t/helper/test-dump-split-index.c
@@ -16,7 +16,6 @@ static void show_bit(size_t pos, void *data UNUSED)
int cmd__dump_split_index(int ac UNUSED, const char **av)
{
struct split_index *si;
- int i;
setup_git_directory();
@@ -28,7 +27,7 @@ int cmd__dump_split_index(int ac UNUSED, const char **av)
return 0;
}
printf("base %s\n", oid_to_hex(&si->base_oid));
- for (i = 0; i < the_repository->index->cache_nr; i++) {
+ for (size_t i = 0; i < the_repository->index->cache_nr; i++) {
struct cache_entry *ce = the_repository->index->cache[i];
printf("%06o %s %d\t%s\n", ce->ce_mode,
oid_to_hex(&ce->oid), ce_stage(ce), ce->name);
diff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c
index b2e70837a9..01a109496b 100644
--- a/t/helper/test-dump-untracked-cache.c
+++ b/t/helper/test-dump-untracked-cache.c
@@ -23,7 +23,7 @@ static int compare_dir(const void *a_, const void *b_)
static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)
{
- int i, len;
+ int len;
QSORT(ucd->untracked, ucd->untracked_nr, compare_untracked);
QSORT(ucd->dirs, ucd->dirs_nr, compare_dir);
len = base->len;
@@ -37,9 +37,9 @@ static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)
if (ucd->valid)
fputs(" valid", stdout);
printf("\n");
- for (i = 0; i < ucd->untracked_nr; i++)
+ for (size_t i = 0; i < ucd->untracked_nr; i++)
printf("%s\n", ucd->untracked[i]);
- for (i = 0; i < ucd->dirs_nr; i++)
+ for (size_t i = 0; i < ucd->dirs_nr; i++)
dump(ucd->dirs[i], base);
strbuf_setlen(base, len);
}
diff --git a/t/helper/test-genrandom.c b/t/helper/test-genrandom.c
index 99b8dc1e2d..51b67f2f87 100644
--- a/t/helper/test-genrandom.c
+++ b/t/helper/test-genrandom.c
@@ -22,7 +22,7 @@ int cmd__genrandom(int argc, const char **argv)
next = next * 11 + *c;
} while (*c++);
- count = (argc == 3) ? strtoul(argv[2], NULL, 0) : -1L;
+ count = (argc == 3) ? strtoul(argv[2], NULL, 0) : ULONG_MAX;
while (count--) {
next = next * 1103515245 + 12345;
diff --git a/t/helper/test-genzeros.c b/t/helper/test-genzeros.c
index 47af843b68..b895436a32 100644
--- a/t/helper/test-genzeros.c
+++ b/t/helper/test-genzeros.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-tool.h"
#include "git-compat-util.h"
diff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c
index 7de822af51..80df1aae66 100644
--- a/t/helper/test-hash-speed.c
+++ b/t/helper/test-hash-speed.c
@@ -16,12 +16,11 @@ int cmd__hash_speed(int ac, const char **av)
unsigned char hash[GIT_MAX_RAWSZ];
clock_t initial, start, end;
unsigned bufsizes[] = { 64, 256, 1024, 8192, 16384 };
- int i;
void *p;
const struct git_hash_algo *algo = NULL;
if (ac == 2) {
- for (i = 1; i < GIT_HASH_NALGOS; i++) {
+ for (size_t i = 1; i < GIT_HASH_NALGOS; i++) {
if (!strcmp(av[1], hash_algos[i].name)) {
algo = &hash_algos[i];
break;
@@ -36,7 +35,7 @@ int cmd__hash_speed(int ac, const char **av)
printf("algo: %s\n", algo->name);
- for (i = 0; i < ARRAY_SIZE(bufsizes); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(bufsizes); i++) {
unsigned long j, kb;
double kb_per_sec;
p = xcalloc(1, bufsizes[i]);
diff --git a/t/helper/test-mergesort.c b/t/helper/test-mergesort.c
index 328bfe2977..791e128793 100644
--- a/t/helper/test-mergesort.c
+++ b/t/helper/test-mergesort.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-tool.h"
#include "mem-pool.h"
#include "mergesort.h"
diff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c
index 5da359486c..bfe45ec68b 100644
--- a/t/helper/test-parse-options.c
+++ b/t/helper/test-parse-options.c
@@ -174,7 +174,6 @@ int cmd__parse_options(int argc, const char **argv)
OPT_ALIAS('Z', "alias-target", "alias-source"),
OPT_END(),
};
- int i;
int ret = 0;
trace2_cmd_name("_parse_");
@@ -198,10 +197,10 @@ int cmd__parse_options(int argc, const char **argv)
show(&expect, &ret, "dry run: %s", dry_run ? "yes" : "no");
show(&expect, &ret, "file: %s", file ? file : "(not set)");
- for (i = 0; i < list.nr; i++)
+ for (size_t i = 0; i < list.nr; i++)
show(&expect, &ret, "list: %s", list.items[i].string);
- for (i = 0; i < argc; i++)
+ for (int i = 0; i < argc; i++)
show(&expect, &ret, "arg %02d: %s", i, argv[i]);
expect.strdup_strings = 1;
diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c
index 3129aa28fd..72ac8d1b1b 100644
--- a/t/helper/test-path-utils.c
+++ b/t/helper/test-path-utils.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "test-tool.h"
#include "abspath.h"
diff --git a/t/helper/test-path-walk.c b/t/helper/test-path-walk.c
new file mode 100644
index 0000000000..7f2d409c5b
--- /dev/null
+++ b/t/helper/test-path-walk.c
@@ -0,0 +1,112 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
+#include "test-tool.h"
+#include "environment.h"
+#include "hex.h"
+#include "object-name.h"
+#include "object.h"
+#include "pretty.h"
+#include "revision.h"
+#include "setup.h"
+#include "parse-options.h"
+#include "path-walk.h"
+#include "oid-array.h"
+
+static const char * const path_walk_usage[] = {
+ N_("test-tool path-walk <options> -- <revision-options>"),
+ NULL
+};
+
+struct path_walk_test_data {
+ uintmax_t batch_nr;
+
+ uintmax_t commit_nr;
+ uintmax_t tree_nr;
+ uintmax_t blob_nr;
+ uintmax_t tag_nr;
+};
+
+static int emit_block(const char *path, struct oid_array *oids,
+ enum object_type type, void *data)
+{
+ struct path_walk_test_data *tdata = data;
+ const char *typestr;
+
+ if (type == OBJ_TREE)
+ tdata->tree_nr += oids->nr;
+ else if (type == OBJ_BLOB)
+ tdata->blob_nr += oids->nr;
+ else if (type == OBJ_COMMIT)
+ tdata->commit_nr += oids->nr;
+ else if (type == OBJ_TAG)
+ tdata->tag_nr += oids->nr;
+ else
+ BUG("we do not understand this type");
+
+ typestr = type_name(type);
+
+ /* This should never be output during tests. */
+ if (!oids->nr)
+ printf("%"PRIuMAX":%s:%s:EMPTY\n",
+ tdata->batch_nr, typestr, path);
+
+ for (size_t i = 0; i < oids->nr; i++) {
+ struct object *o = lookup_unknown_object(the_repository,
+ &oids->oid[i]);
+ printf("%"PRIuMAX":%s:%s:%s%s\n",
+ tdata->batch_nr, typestr, path,
+ oid_to_hex(&oids->oid[i]),
+ o->flags & UNINTERESTING ? ":UNINTERESTING" : "");
+ }
+
+ tdata->batch_nr++;
+ return 0;
+}
+
+int cmd__path_walk(int argc, const char **argv)
+{
+ int res;
+ struct rev_info revs = REV_INFO_INIT;
+ struct path_walk_info info = PATH_WALK_INFO_INIT;
+ struct path_walk_test_data data = { 0 };
+ struct option options[] = {
+ OPT_BOOL(0, "blobs", &info.blobs,
+ N_("toggle inclusion of blob objects")),
+ OPT_BOOL(0, "commits", &info.commits,
+ N_("toggle inclusion of commit objects")),
+ OPT_BOOL(0, "tags", &info.tags,
+ N_("toggle inclusion of tag objects")),
+ OPT_BOOL(0, "trees", &info.trees,
+ N_("toggle inclusion of tree objects")),
+ OPT_BOOL(0, "prune", &info.prune_all_uninteresting,
+ N_("toggle pruning of uninteresting paths")),
+ OPT_END(),
+ };
+
+ setup_git_directory();
+ revs.repo = the_repository;
+
+ argc = parse_options(argc, argv, NULL,
+ options, path_walk_usage,
+ PARSE_OPT_KEEP_UNKNOWN_OPT | PARSE_OPT_KEEP_ARGV0);
+
+ if (argc > 1)
+ setup_revisions(argc, argv, &revs, NULL);
+ else
+ usage(path_walk_usage[0]);
+
+ info.revs = &revs;
+ info.path_fn = emit_block;
+ info.path_fn_data = &data;
+
+ res = walk_objects_by_path(&info);
+
+ printf("commits:%" PRIuMAX "\n"
+ "trees:%" PRIuMAX "\n"
+ "blobs:%" PRIuMAX "\n"
+ "tags:%" PRIuMAX "\n",
+ data.commit_nr, data.tree_nr, data.blob_nr, data.tag_nr);
+
+ release_revisions(&revs);
+ return res;
+}
diff --git a/t/helper/test-progress.c b/t/helper/test-progress.c
index 44be2645e9..1f75b7bd19 100644
--- a/t/helper/test-progress.c
+++ b/t/helper/test-progress.c
@@ -17,10 +17,14 @@
*
* See 't0500-progress-display.sh' for examples.
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
#define GIT_TEST_PROGRESS_ONLY
+
#include "test-tool.h"
#include "parse-options.h"
#include "progress.h"
+#include "repository.h"
#include "strbuf.h"
#include "string-list.h"
@@ -64,7 +68,7 @@ int cmd__progress(int argc, const char **argv)
else
die("invalid input: '%s'", line.buf);
- progress = start_progress(title, total);
+ progress = start_progress(the_repository, title, total);
} else if (skip_prefix(line.buf, "progress ", (const char **) &end)) {
uint64_t item_count = strtoull(end, &end, 10);
if (*end != '\0')
diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c
index 84deee604a..028ec00306 100644
--- a/t/helper/test-reach.c
+++ b/t/helper/test-reach.c
@@ -13,7 +13,6 @@
static void print_sorted_commit_ids(struct commit_list *list)
{
- int i;
struct string_list s = STRING_LIST_INIT_DUP;
while (list) {
@@ -23,7 +22,7 @@ static void print_sorted_commit_ids(struct commit_list *list)
string_list_sort(&s);
- for (i = 0; i < s.nr; i++)
+ for (size_t i = 0; i < s.nr; i++)
printf("%s\n", s.items[i].string);
string_list_clear(&s, 0);
@@ -36,7 +35,7 @@ int cmd__reach(int ac, const char **av)
struct commit_list *X, *Y;
struct object_array X_obj = OBJECT_ARRAY_INIT;
struct commit **X_array, **Y_array;
- int X_nr, X_alloc, Y_nr, Y_alloc;
+ size_t X_nr, X_alloc, Y_nr, Y_alloc;
struct strbuf buf = STRBUF_INIT;
struct repository *r = the_repository;
@@ -158,7 +157,7 @@ int cmd__reach(int ac, const char **av)
clear_contains_cache(&cache);
} else if (!strcmp(av[1], "get_reachable_subset")) {
const int reachable_flag = 1;
- int i, count = 0;
+ int count = 0;
struct commit_list *current;
struct commit_list *list = get_reachable_subset(X_array, X_nr,
Y_array, Y_nr,
@@ -170,7 +169,7 @@ int cmd__reach(int ac, const char **av)
oid_to_hex(&list->item->object.oid));
count++;
}
- for (i = 0; i < Y_nr; i++) {
+ for (size_t i = 0; i < Y_nr; i++) {
if (Y_array[i]->object.flags & reachable_flag)
count--;
}
diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c
index 438fb9fc61..fc63236961 100644
--- a/t/helper/test-read-midx.c
+++ b/t/helper/test-read-midx.c
@@ -18,7 +18,7 @@ static int read_midx_file(const char *object_dir, const char *checksum,
struct multi_pack_index *m;
setup_git_directory();
- m = load_multi_pack_index(object_dir, 1);
+ m = load_multi_pack_index(the_repository, object_dir, 1);
if (!m)
return 1;
@@ -82,7 +82,7 @@ static int read_midx_checksum(const char *object_dir)
struct multi_pack_index *m;
setup_git_directory();
- m = load_multi_pack_index(object_dir, 1);
+ m = load_multi_pack_index(the_repository, object_dir, 1);
if (!m)
return 1;
printf("%s\n", hash_to_hex(get_midx_checksum(m)));
@@ -98,7 +98,7 @@ static int read_midx_preferred_pack(const char *object_dir)
setup_git_directory();
- midx = load_multi_pack_index(object_dir, 1);
+ midx = load_multi_pack_index(the_repository, object_dir, 1);
if (!midx)
return 1;
@@ -121,7 +121,7 @@ static int read_midx_bitmapped_packs(const char *object_dir)
setup_git_directory();
- midx = load_multi_pack_index(object_dir, 1);
+ midx = load_multi_pack_index(the_repository, object_dir, 1);
if (!midx)
return 1;
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index 240f6fc29d..1cc05f043a 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -24,14 +24,13 @@ struct flag_definition {
static unsigned int parse_flags(const char *str, struct flag_definition *defs)
{
struct string_list masks = STRING_LIST_INIT_DUP;
- int i = 0;
unsigned int result = 0;
if (!strcmp(str, "0"))
return 0;
string_list_split(&masks, str, ',', 64);
- for (; i < masks.nr; i++) {
+ for (size_t i = 0; i < masks.nr; i++) {
const char *name = masks.items[i].string;
struct flag_definition *def = defs;
int found = 0;
diff --git a/t/helper/test-reftable.c b/t/helper/test-reftable.c
index 5c8849d115..3c72ed985b 100644
--- a/t/helper/test-reftable.c
+++ b/t/helper/test-reftable.c
@@ -156,7 +156,7 @@ int cmd__dump_reftable(int argc, const char **argv)
int opt_dump_blocks = 0;
int opt_dump_table = 0;
int opt_dump_stack = 0;
- uint32_t opt_hash_id = GIT_SHA1_FORMAT_ID;
+ uint32_t opt_hash_id = REFTABLE_HASH_SHA1;
const char *arg = NULL, *argv0 = argv[0];
for (; argc > 1; argv++, argc--)
@@ -167,7 +167,7 @@ int cmd__dump_reftable(int argc, const char **argv)
else if (!strcmp("-t", argv[1]))
opt_dump_table = 1;
else if (!strcmp("-6", argv[1]))
- opt_hash_id = GIT_SHA256_FORMAT_ID;
+ opt_hash_id = REFTABLE_HASH_SHA256;
else if (!strcmp("-s", argv[1]))
opt_dump_stack = 1;
else if (!strcmp("-?", argv[1]) || !strcmp("-h", argv[1])) {
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index 61eb1175fe..3719f23cc2 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -8,6 +8,8 @@
* published by the Free Software Foundation.
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-tool.h"
#include "run-command.h"
#include "strvec.h"
diff --git a/t/helper/test-serve-v2.c b/t/helper/test-serve-v2.c
index 054cbcf5d8..63a200b8d4 100644
--- a/t/helper/test-serve-v2.c
+++ b/t/helper/test-serve-v2.c
@@ -1,6 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "gettext.h"
#include "parse-options.h"
+#include "repository.h"
#include "serve.h"
#include "setup.h"
@@ -28,9 +31,9 @@ int cmd__serve_v2(int argc, const char **argv)
PARSE_OPT_KEEP_UNKNOWN_OPT);
if (advertise_capabilities)
- protocol_v2_advertise_capabilities();
+ protocol_v2_advertise_capabilities(the_repository);
else
- protocol_v2_serve_loop(stateless_rpc);
+ protocol_v2_serve_loop(the_repository, stateless_rpc);
return 0;
}
diff --git a/t/helper/test-simple-ipc.c b/t/helper/test-simple-ipc.c
index fb5927775d..03cc5eea2c 100644
--- a/t/helper/test-simple-ipc.c
+++ b/t/helper/test-simple-ipc.c
@@ -612,8 +612,8 @@ int cmd__simple_ipc(int argc, const char **argv)
if (argc < 2)
usage_with_options(simple_ipc_usage, options);
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(simple_ipc_usage, options);
+ show_usage_with_options_if_asked(argc, argv,
+ simple_ipc_usage, options);
if (argc == 2 && !strcmp(argv[1], "SUPPORTS_SIMPLE_IPC"))
return 0;
diff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c
index e2aad611d1..6f10c5a435 100644
--- a/t/helper/test-string-list.c
+++ b/t/helper/test-string-list.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-tool.h"
#include "strbuf.h"
#include "string-list.h"
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 1ebb69a5dc..69a9ffa1eb 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -52,6 +52,7 @@ static struct test_cmd cmds[] = {
{ "parse-subcommand", cmd__parse_subcommand },
{ "partial-clone", cmd__partial_clone },
{ "path-utils", cmd__path_utils },
+ { "path-walk", cmd__path_walk },
{ "pcre2-config", cmd__pcre2_config },
{ "pkt-line", cmd__pkt_line },
{ "proc-receive", cmd__proc_receive },
@@ -101,7 +102,6 @@ static NORETURN void die_usage(void)
int cmd_main(int argc, const char **argv)
{
- int i;
const char *working_directory = NULL;
struct option options[] = {
OPT_STRING('C', NULL, &working_directory, "directory",
@@ -120,7 +120,7 @@ int cmd_main(int argc, const char **argv)
if (working_directory && chdir(working_directory) < 0)
die("Could not cd to '%s'", working_directory);
- for (i = 0; i < ARRAY_SIZE(cmds); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(cmds); i++) {
if (!strcmp(cmds[i].name, argv[1])) {
argv++;
argc--;
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index 21802ac27d..9cfc5da6e5 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -45,6 +45,7 @@ int cmd__parse_pathspec_file(int argc, const char** argv);
int cmd__parse_subcommand(int argc, const char **argv);
int cmd__partial_clone(int argc, const char **argv);
int cmd__path_utils(int argc, const char **argv);
+int cmd__path_walk(int argc, const char **argv);
int cmd__pcre2_config(int argc, const char **argv);
int cmd__pkt_line(int argc, const char **argv);
int cmd__proc_receive(int argc, const char **argv);
diff --git a/t/helper/test-trace2.c b/t/helper/test-trace2.c
index c588c273ce..415df078c1 100644
--- a/t/helper/test-trace2.c
+++ b/t/helper/test-trace2.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "test-tool.h"
#include "strvec.h"
diff --git a/t/lib-credential.sh b/t/lib-credential.sh
index 58b9c74060..cc6bf9aa5f 100644
--- a/t/lib-credential.sh
+++ b/t/lib-credential.sh
@@ -566,6 +566,21 @@ helper_test_authtype() {
EOF
'
+ test_expect_success "helper ($HELPER) gets authtype and credential only if request has authtype capability" '
+ check fill $HELPER <<-\EOF
+ protocol=https
+ host=git.example.com
+ --
+ protocol=https
+ host=git.example.com
+ username=askpass-username
+ password=askpass-password
+ --
+ askpass: Username for '\''https://git.example.com'\'':
+ askpass: Password for '\''https://askpass-username@git.example.com'\'':
+ EOF
+ '
+
test_expect_success "helper ($HELPER) stores authtype and credential with username" '
check approve $HELPER <<-\EOF
capability[]=authtype
diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh
index cc6bb2cdea..7a734c6973 100644
--- a/t/lib-gettext.sh
+++ b/t/lib-gettext.sh
@@ -6,8 +6,8 @@
. ./test-lib.sh
-GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
-GIT_PO_PATH="$GIT_BUILD_DIR/po"
+GIT_TEXTDOMAINDIR="$GIT_TEST_TEXTDOMAINDIR"
+GIT_PO_PATH="$GIT_TEST_POPATH"
export GIT_TEXTDOMAINDIR GIT_PO_PATH
if test -n "$GIT_TEST_INSTALLED"
diff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh
index 7f9808ec20..a6e3dd11b3 100644
--- a/t/lib-gitweb.sh
+++ b/t/lib-gitweb.sh
@@ -105,6 +105,11 @@ if ! test_have_prereq PERL; then
test_done
fi
+if ! test_have_prereq GITWEB; then
+ skip_all='skipping gitweb tests, gitweb not available'
+ test_done
+fi
+
perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || {
skip_all='skipping gitweb tests, perl version is too old'
test_done
diff --git a/t/meson.build b/t/meson.build
new file mode 100644
index 0000000000..35f25ca4a1
--- /dev/null
+++ b/t/meson.build
@@ -0,0 +1,1151 @@
+clar_test_suites = [
+ 'unit-tests/u-ctype.c',
+ 'unit-tests/u-hash.c',
+ 'unit-tests/u-mem-pool.c',
+ 'unit-tests/u-prio-queue.c',
+ 'unit-tests/u-reftable-tree.c',
+ 'unit-tests/u-strvec.c',
+]
+
+clar_sources = [
+ 'unit-tests/clar/clar.c',
+ 'unit-tests/unit-test.c',
+]
+
+clar_decls_h = custom_target(
+ input: clar_test_suites,
+ output: 'clar-decls.h',
+ command : [
+ shell,
+ meson.current_source_dir() + '/unit-tests/generate-clar-decls.sh',
+ '@OUTPUT@',
+ '@INPUT@',
+ ],
+ env: script_environment,
+)
+clar_sources += clar_decls_h
+
+clar_sources += custom_target(
+ input: clar_decls_h,
+ output: 'clar.suite',
+ command : [
+ shell,
+ meson.current_source_dir() + '/unit-tests/generate-clar-suites.sh',
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ env: script_environment,
+)
+
+clar_unit_tests = executable('unit-tests',
+ sources: clar_sources + clar_test_suites,
+ dependencies: [libgit, common_main],
+)
+test('unit-tests', clar_unit_tests)
+
+unit_test_programs = [
+ 'unit-tests/t-example-decorate.c',
+ 'unit-tests/t-hashmap.c',
+ 'unit-tests/t-oid-array.c',
+ 'unit-tests/t-oidmap.c',
+ 'unit-tests/t-oidtree.c',
+ 'unit-tests/t-reftable-basics.c',
+ 'unit-tests/t-reftable-block.c',
+ 'unit-tests/t-reftable-merged.c',
+ 'unit-tests/t-reftable-pq.c',
+ 'unit-tests/t-reftable-reader.c',
+ 'unit-tests/t-reftable-readwrite.c',
+ 'unit-tests/t-reftable-record.c',
+ 'unit-tests/t-reftable-stack.c',
+ 'unit-tests/t-strbuf.c',
+ 'unit-tests/t-strcmp-offset.c',
+ 'unit-tests/t-trailer.c',
+ 'unit-tests/t-urlmatch-normalization.c',
+]
+
+foreach unit_test_program : unit_test_programs
+ unit_test_name = fs.stem(unit_test_program)
+ unit_test = executable(unit_test_name,
+ sources: [
+ 'unit-tests/test-lib.c',
+ 'unit-tests/lib-oid.c',
+ 'unit-tests/lib-reftable.c',
+ unit_test_program,
+ ],
+ dependencies: [libgit, common_main],
+ )
+ test(unit_test_name, unit_test,
+ workdir: meson.current_source_dir(),
+ timeout: 0,
+ )
+endforeach
+
+subdir('helper')
+
+integration_tests = [
+ 't0000-basic.sh',
+ 't0001-init.sh',
+ 't0002-gitfile.sh',
+ 't0003-attributes.sh',
+ 't0004-unwritable.sh',
+ 't0005-signals.sh',
+ 't0006-date.sh',
+ 't0007-git-var.sh',
+ 't0008-ignores.sh',
+ 't0010-racy-git.sh',
+ 't0012-help.sh',
+ 't0013-sha1dc.sh',
+ 't0014-alias.sh',
+ 't0017-env-helper.sh',
+ 't0018-advice.sh',
+ 't0019-json-writer.sh',
+ 't0020-crlf.sh',
+ 't0021-conversion.sh',
+ 't0022-crlf-rename.sh',
+ 't0023-crlf-am.sh',
+ 't0024-crlf-archive.sh',
+ 't0025-crlf-renormalize.sh',
+ 't0026-eol-config.sh',
+ 't0027-auto-crlf.sh',
+ 't0028-working-tree-encoding.sh',
+ 't0029-core-unsetenvvars.sh',
+ 't0030-stripspace.sh',
+ 't0033-safe-directory.sh',
+ 't0034-root-safe-directory.sh',
+ 't0035-safe-bare-repository.sh',
+ 't0040-parse-options.sh',
+ 't0041-usage.sh',
+ 't0050-filesystem.sh',
+ 't0051-windows-named-pipe.sh',
+ 't0052-simple-ipc.sh',
+ 't0055-beyond-symlinks.sh',
+ 't0056-git-C.sh',
+ 't0060-path-utils.sh',
+ 't0061-run-command.sh',
+ 't0062-revision-walking.sh',
+ 't0063-string-list.sh',
+ 't0066-dir-iterator.sh',
+ 't0067-parse_pathspec_file.sh',
+ 't0068-for-each-repo.sh',
+ 't0070-fundamental.sh',
+ 't0071-sort.sh',
+ 't0080-unit-test-output.sh',
+ 't0081-find-pack.sh',
+ 't0090-cache-tree.sh',
+ 't0091-bugreport.sh',
+ 't0092-diagnose.sh',
+ 't0095-bloom.sh',
+ 't0100-previous.sh',
+ 't0101-at-syntax.sh',
+ 't0200-gettext-basic.sh',
+ 't0201-gettext-fallbacks.sh',
+ 't0202-gettext-perl.sh',
+ 't0203-gettext-setlocale-sanity.sh',
+ 't0204-gettext-reencode-sanity.sh',
+ 't0210-trace2-normal.sh',
+ 't0211-trace2-perf.sh',
+ 't0212-trace2-event.sh',
+ 't0300-credentials.sh',
+ 't0301-credential-cache.sh',
+ 't0302-credential-store.sh',
+ 't0303-credential-external.sh',
+ 't0410-partial-clone.sh',
+ 't0411-clone-from-partial.sh',
+ 't0450-txt-doc-vs-help.sh',
+ 't0500-progress-display.sh',
+ 't0600-reffiles-backend.sh',
+ 't0601-reffiles-pack-refs.sh',
+ 't0602-reffiles-fsck.sh',
+ 't0610-reftable-basics.sh',
+ 't0611-reftable-httpd.sh',
+ 't0612-reftable-jgit-compatibility.sh',
+ 't0613-reftable-write-options.sh',
+ 't1000-read-tree-m-3way.sh',
+ 't1001-read-tree-m-2way.sh',
+ 't1002-read-tree-m-u-2way.sh',
+ 't1003-read-tree-prefix.sh',
+ 't1004-read-tree-m-u-wf.sh',
+ 't1005-read-tree-reset.sh',
+ 't1006-cat-file.sh',
+ 't1007-hash-object.sh',
+ 't1008-read-tree-overlay.sh',
+ 't1009-read-tree-new-index.sh',
+ 't1010-mktree.sh',
+ 't1011-read-tree-sparse-checkout.sh',
+ 't1012-read-tree-df.sh',
+ 't1013-read-tree-submodule.sh',
+ 't1014-read-tree-confusing.sh',
+ 't1015-read-index-unmerged.sh',
+ 't1016-compatObjectFormat.sh',
+ 't1020-subdirectory.sh',
+ 't1021-rerere-in-workdir.sh',
+ 't1022-read-tree-partial-clone.sh',
+ 't1050-large.sh',
+ 't1051-large-conversion.sh',
+ 't1060-object-corruption.sh',
+ 't1090-sparse-checkout-scope.sh',
+ 't1091-sparse-checkout-builtin.sh',
+ 't1092-sparse-checkout-compatibility.sh',
+ 't1100-commit-tree-options.sh',
+ 't1300-config.sh',
+ 't1301-shared-repo.sh',
+ 't1302-repo-version.sh',
+ 't1303-wacky-config.sh',
+ 't1304-default-acl.sh',
+ 't1305-config-include.sh',
+ 't1306-xdg-files.sh',
+ 't1307-config-blob.sh',
+ 't1308-config-set.sh',
+ 't1309-early-config.sh',
+ 't1310-config-default.sh',
+ 't1350-config-hooks-path.sh',
+ 't1400-update-ref.sh',
+ 't1401-symbolic-ref.sh',
+ 't1402-check-ref-format.sh',
+ 't1403-show-ref.sh',
+ 't1404-update-ref-errors.sh',
+ 't1405-main-ref-store.sh',
+ 't1406-submodule-ref-store.sh',
+ 't1407-worktree-ref-store.sh',
+ 't1408-packed-refs.sh',
+ 't1409-avoid-packing-refs.sh',
+ 't1410-reflog.sh',
+ 't1411-reflog-show.sh',
+ 't1412-reflog-loop.sh',
+ 't1413-reflog-detach.sh',
+ 't1414-reflog-walk.sh',
+ 't1415-worktree-refs.sh',
+ 't1416-ref-transaction-hooks.sh',
+ 't1417-reflog-updateref.sh',
+ 't1418-reflog-exists.sh',
+ 't1419-exclude-refs.sh',
+ 't1420-lost-found.sh',
+ 't1430-bad-ref-name.sh',
+ 't1450-fsck.sh',
+ 't1451-fsck-buffer.sh',
+ 't1460-refs-migrate.sh',
+ 't1500-rev-parse.sh',
+ 't1501-work-tree.sh',
+ 't1502-rev-parse-parseopt.sh',
+ 't1503-rev-parse-verify.sh',
+ 't1504-ceiling-dirs.sh',
+ 't1505-rev-parse-last.sh',
+ 't1506-rev-parse-diagnosis.sh',
+ 't1507-rev-parse-upstream.sh',
+ 't1508-at-combinations.sh',
+ 't1509-root-work-tree.sh',
+ 't1510-repo-setup.sh',
+ 't1511-rev-parse-caret.sh',
+ 't1512-rev-parse-disambiguation.sh',
+ 't1513-rev-parse-prefix.sh',
+ 't1514-rev-parse-push.sh',
+ 't1515-rev-parse-outside-repo.sh',
+ 't1517-outside-repo.sh',
+ 't1600-index.sh',
+ 't1601-index-bogus.sh',
+ 't1700-split-index.sh',
+ 't1701-racy-split-index.sh',
+ 't1800-hook.sh',
+ 't2000-conflict-when-checking-files-out.sh',
+ 't2002-checkout-cache-u.sh',
+ 't2003-checkout-cache-mkdir.sh',
+ 't2004-checkout-cache-temp.sh',
+ 't2005-checkout-index-symlinks.sh',
+ 't2006-checkout-index-basic.sh',
+ 't2007-checkout-symlink.sh',
+ 't2008-checkout-subdir.sh',
+ 't2009-checkout-statinfo.sh',
+ 't2010-checkout-ambiguous.sh',
+ 't2011-checkout-invalid-head.sh',
+ 't2012-checkout-last.sh',
+ 't2013-checkout-submodule.sh',
+ 't2014-checkout-switch.sh',
+ 't2015-checkout-unborn.sh',
+ 't2016-checkout-patch.sh',
+ 't2017-checkout-orphan.sh',
+ 't2018-checkout-branch.sh',
+ 't2019-checkout-ambiguous-ref.sh',
+ 't2020-checkout-detach.sh',
+ 't2021-checkout-overwrite.sh',
+ 't2022-checkout-paths.sh',
+ 't2023-checkout-m.sh',
+ 't2024-checkout-dwim.sh',
+ 't2025-checkout-no-overlay.sh',
+ 't2026-checkout-pathspec-file.sh',
+ 't2027-checkout-track.sh',
+ 't2030-unresolve-info.sh',
+ 't2050-git-dir-relative.sh',
+ 't2060-switch.sh',
+ 't2070-restore.sh',
+ 't2071-restore-patch.sh',
+ 't2072-restore-pathspec-file.sh',
+ 't2080-parallel-checkout-basics.sh',
+ 't2081-parallel-checkout-collisions.sh',
+ 't2082-parallel-checkout-attributes.sh',
+ 't2100-update-cache-badpath.sh',
+ 't2101-update-index-reupdate.sh',
+ 't2102-update-index-symlinks.sh',
+ 't2103-update-index-ignore-missing.sh',
+ 't2104-update-index-skip-worktree.sh',
+ 't2105-update-index-gitfile.sh',
+ 't2106-update-index-assume-unchanged.sh',
+ 't2107-update-index-basic.sh',
+ 't2108-update-index-refresh-racy.sh',
+ 't2200-add-update.sh',
+ 't2201-add-update-typechange.sh',
+ 't2202-add-addremove.sh',
+ 't2203-add-intent.sh',
+ 't2204-add-ignored.sh',
+ 't2205-add-worktree-config.sh',
+ 't2300-cd-to-toplevel.sh',
+ 't2400-worktree-add.sh',
+ 't2401-worktree-prune.sh',
+ 't2402-worktree-list.sh',
+ 't2403-worktree-move.sh',
+ 't2404-worktree-config.sh',
+ 't2405-worktree-submodule.sh',
+ 't2406-worktree-repair.sh',
+ 't2407-worktree-heads.sh',
+ 't2500-untracked-overwriting.sh',
+ 't2501-cwd-empty.sh',
+ 't3000-ls-files-others.sh',
+ 't3001-ls-files-others-exclude.sh',
+ 't3002-ls-files-dashpath.sh',
+ 't3003-ls-files-exclude.sh',
+ 't3004-ls-files-basic.sh',
+ 't3005-ls-files-relative.sh',
+ 't3006-ls-files-long.sh',
+ 't3007-ls-files-recurse-submodules.sh',
+ 't3008-ls-files-lazy-init-name-hash.sh',
+ 't3009-ls-files-others-nonsubmodule.sh',
+ 't3010-ls-files-killed-modified.sh',
+ 't3011-common-prefixes-and-directory-traversal.sh',
+ 't3012-ls-files-dedup.sh',
+ 't3013-ls-files-format.sh',
+ 't3020-ls-files-error-unmatch.sh',
+ 't3040-subprojects-basic.sh',
+ 't3050-subprojects-fetch.sh',
+ 't3060-ls-files-with-tree.sh',
+ 't3070-wildmatch.sh',
+ 't3100-ls-tree-restrict.sh',
+ 't3101-ls-tree-dirname.sh',
+ 't3102-ls-tree-wildcards.sh',
+ 't3103-ls-tree-misc.sh',
+ 't3104-ls-tree-format.sh',
+ 't3105-ls-tree-output.sh',
+ 't3200-branch.sh',
+ 't3201-branch-contains.sh',
+ 't3202-show-branch.sh',
+ 't3203-branch-output.sh',
+ 't3204-branch-name-interpretation.sh',
+ 't3205-branch-color.sh',
+ 't3206-range-diff.sh',
+ 't3207-branch-submodule.sh',
+ 't3211-peel-ref.sh',
+ 't3300-funny-names.sh',
+ 't3301-notes.sh',
+ 't3302-notes-index-expensive.sh',
+ 't3303-notes-subtrees.sh',
+ 't3304-notes-mixed.sh',
+ 't3305-notes-fanout.sh',
+ 't3306-notes-prune.sh',
+ 't3307-notes-man.sh',
+ 't3308-notes-merge.sh',
+ 't3309-notes-merge-auto-resolve.sh',
+ 't3310-notes-merge-manual-resolve.sh',
+ 't3311-notes-merge-fanout.sh',
+ 't3320-notes-merge-worktrees.sh',
+ 't3321-notes-stripspace.sh',
+ 't3400-rebase.sh',
+ 't3401-rebase-and-am-rename.sh',
+ 't3402-rebase-merge.sh',
+ 't3403-rebase-skip.sh',
+ 't3404-rebase-interactive.sh',
+ 't3405-rebase-malformed.sh',
+ 't3406-rebase-message.sh',
+ 't3407-rebase-abort.sh',
+ 't3408-rebase-multi-line.sh',
+ 't3409-rebase-environ.sh',
+ 't3412-rebase-root.sh',
+ 't3413-rebase-hook.sh',
+ 't3415-rebase-autosquash.sh',
+ 't3416-rebase-onto-threedots.sh',
+ 't3417-rebase-whitespace-fix.sh',
+ 't3418-rebase-continue.sh',
+ 't3419-rebase-patch-id.sh',
+ 't3420-rebase-autostash.sh',
+ 't3421-rebase-topology-linear.sh',
+ 't3422-rebase-incompatible-options.sh',
+ 't3423-rebase-reword.sh',
+ 't3424-rebase-empty.sh',
+ 't3425-rebase-topology-merges.sh',
+ 't3426-rebase-submodule.sh',
+ 't3427-rebase-subtree.sh',
+ 't3428-rebase-signoff.sh',
+ 't3429-rebase-edit-todo.sh',
+ 't3430-rebase-merges.sh',
+ 't3431-rebase-fork-point.sh',
+ 't3432-rebase-fast-forward.sh',
+ 't3433-rebase-across-mode-change.sh',
+ 't3434-rebase-i18n.sh',
+ 't3435-rebase-gpg-sign.sh',
+ 't3436-rebase-more-options.sh',
+ 't3437-rebase-fixup-options.sh',
+ 't3438-rebase-broken-files.sh',
+ 't3500-cherry.sh',
+ 't3501-revert-cherry-pick.sh',
+ 't3502-cherry-pick-merge.sh',
+ 't3503-cherry-pick-root.sh',
+ 't3504-cherry-pick-rerere.sh',
+ 't3505-cherry-pick-empty.sh',
+ 't3506-cherry-pick-ff.sh',
+ 't3507-cherry-pick-conflict.sh',
+ 't3508-cherry-pick-many-commits.sh',
+ 't3509-cherry-pick-merge-df.sh',
+ 't3510-cherry-pick-sequence.sh',
+ 't3511-cherry-pick-x.sh',
+ 't3512-cherry-pick-submodule.sh',
+ 't3513-revert-submodule.sh',
+ 't3514-cherry-pick-revert-gpg.sh',
+ 't3600-rm.sh',
+ 't3601-rm-pathspec-file.sh',
+ 't3602-rm-sparse-checkout.sh',
+ 't3650-replay-basics.sh',
+ 't3700-add.sh',
+ 't3701-add-interactive.sh',
+ 't3702-add-edit.sh',
+ 't3703-add-magic-pathspec.sh',
+ 't3704-add-pathspec-file.sh',
+ 't3705-add-sparse-checkout.sh',
+ 't3800-mktag.sh',
+ 't3900-i18n-commit.sh',
+ 't3901-i18n-patch.sh',
+ 't3902-quoted.sh',
+ 't3903-stash.sh',
+ 't3904-stash-patch.sh',
+ 't3905-stash-include-untracked.sh',
+ 't3906-stash-submodule.sh',
+ 't3907-stash-show-config.sh',
+ 't3908-stash-in-worktree.sh',
+ 't3909-stash-pathspec-file.sh',
+ 't3910-mac-os-precompose.sh',
+ 't3920-crlf-messages.sh',
+ 't4000-diff-format.sh',
+ 't4001-diff-rename.sh',
+ 't4002-diff-basic.sh',
+ 't4003-diff-rename-1.sh',
+ 't4004-diff-rename-symlink.sh',
+ 't4005-diff-rename-2.sh',
+ 't4006-diff-mode.sh',
+ 't4007-rename-3.sh',
+ 't4008-diff-break-rewrite.sh',
+ 't4009-diff-rename-4.sh',
+ 't4010-diff-pathspec.sh',
+ 't4011-diff-symlink.sh',
+ 't4012-diff-binary.sh',
+ 't4013-diff-various.sh',
+ 't4014-format-patch.sh',
+ 't4015-diff-whitespace.sh',
+ 't4016-diff-quote.sh',
+ 't4017-diff-retval.sh',
+ 't4018-diff-funcname.sh',
+ 't4019-diff-wserror.sh',
+ 't4020-diff-external.sh',
+ 't4021-format-patch-numbered.sh',
+ 't4022-diff-rewrite.sh',
+ 't4023-diff-rename-typechange.sh',
+ 't4024-diff-optimize-common.sh',
+ 't4025-hunk-header.sh',
+ 't4026-color.sh',
+ 't4027-diff-submodule.sh',
+ 't4028-format-patch-mime-headers.sh',
+ 't4029-diff-trailing-space.sh',
+ 't4030-diff-textconv.sh',
+ 't4031-diff-rewrite-binary.sh',
+ 't4032-diff-inter-hunk-context.sh',
+ 't4033-diff-patience.sh',
+ 't4034-diff-words.sh',
+ 't4035-diff-quiet.sh',
+ 't4036-format-patch-signer-mime.sh',
+ 't4037-diff-r-t-dirs.sh',
+ 't4038-diff-combined.sh',
+ 't4039-diff-assume-unchanged.sh',
+ 't4040-whitespace-status.sh',
+ 't4041-diff-submodule-option.sh',
+ 't4042-diff-textconv-caching.sh',
+ 't4043-diff-rename-binary.sh',
+ 't4044-diff-index-unique-abbrev.sh',
+ 't4045-diff-relative.sh',
+ 't4046-diff-unmerged.sh',
+ 't4047-diff-dirstat.sh',
+ 't4048-diff-combined-binary.sh',
+ 't4049-diff-stat-count.sh',
+ 't4050-diff-histogram.sh',
+ 't4051-diff-function-context.sh',
+ 't4052-stat-output.sh',
+ 't4053-diff-no-index.sh',
+ 't4054-diff-bogus-tree.sh',
+ 't4055-diff-context.sh',
+ 't4056-diff-order.sh',
+ 't4057-diff-combined-paths.sh',
+ 't4058-diff-duplicates.sh',
+ 't4059-diff-submodule-not-initialized.sh',
+ 't4060-diff-submodule-option-diff-format.sh',
+ 't4061-diff-indent.sh',
+ 't4062-diff-pickaxe.sh',
+ 't4063-diff-blobs.sh',
+ 't4064-diff-oidfind.sh',
+ 't4065-diff-anchored.sh',
+ 't4066-diff-emit-delay.sh',
+ 't4067-diff-partial-clone.sh',
+ 't4068-diff-symmetric-merge-base.sh',
+ 't4069-remerge-diff.sh',
+ 't4100-apply-stat.sh',
+ 't4101-apply-nonl.sh',
+ 't4102-apply-rename.sh',
+ 't4103-apply-binary.sh',
+ 't4104-apply-boundary.sh',
+ 't4105-apply-fuzz.sh',
+ 't4106-apply-stdin.sh',
+ 't4107-apply-ignore-whitespace.sh',
+ 't4108-apply-threeway.sh',
+ 't4109-apply-multifrag.sh',
+ 't4110-apply-scan.sh',
+ 't4111-apply-subdir.sh',
+ 't4112-apply-renames.sh',
+ 't4113-apply-ending.sh',
+ 't4114-apply-typechange.sh',
+ 't4115-apply-symlink.sh',
+ 't4116-apply-reverse.sh',
+ 't4117-apply-reject.sh',
+ 't4118-apply-empty-context.sh',
+ 't4119-apply-config.sh',
+ 't4120-apply-popt.sh',
+ 't4121-apply-diffs.sh',
+ 't4122-apply-symlink-inside.sh',
+ 't4123-apply-shrink.sh',
+ 't4124-apply-ws-rule.sh',
+ 't4125-apply-ws-fuzz.sh',
+ 't4126-apply-empty.sh',
+ 't4127-apply-same-fn.sh',
+ 't4128-apply-root.sh',
+ 't4129-apply-samemode.sh',
+ 't4130-apply-criss-cross-rename.sh',
+ 't4131-apply-fake-ancestor.sh',
+ 't4132-apply-removal.sh',
+ 't4133-apply-filenames.sh',
+ 't4134-apply-submodule.sh',
+ 't4135-apply-weird-filenames.sh',
+ 't4136-apply-check.sh',
+ 't4137-apply-submodule.sh',
+ 't4138-apply-ws-expansion.sh',
+ 't4139-apply-escape.sh',
+ 't4140-apply-ita.sh',
+ 't4141-apply-too-large.sh',
+ 't4150-am.sh',
+ 't4151-am-abort.sh',
+ 't4152-am-subjects.sh',
+ 't4153-am-resume-override-opts.sh',
+ 't4200-rerere.sh',
+ 't4201-shortlog.sh',
+ 't4202-log.sh',
+ 't4203-mailmap.sh',
+ 't4204-patch-id.sh',
+ 't4205-log-pretty-formats.sh',
+ 't4206-log-follow-harder-copies.sh',
+ 't4207-log-decoration-colors.sh',
+ 't4208-log-magic-pathspec.sh',
+ 't4209-log-pickaxe.sh',
+ 't4210-log-i18n.sh',
+ 't4211-line-log.sh',
+ 't4212-log-corrupt.sh',
+ 't4213-log-tabexpand.sh',
+ 't4214-log-graph-octopus.sh',
+ 't4215-log-skewed-merges.sh',
+ 't4216-log-bloom.sh',
+ 't4217-log-limit.sh',
+ 't4252-am-options.sh',
+ 't4253-am-keep-cr-dos.sh',
+ 't4254-am-corrupt.sh',
+ 't4255-am-submodule.sh',
+ 't4256-am-format-flowed.sh',
+ 't4257-am-interactive.sh',
+ 't4258-am-quoted-cr.sh',
+ 't4300-merge-tree.sh',
+ 't4301-merge-tree-write-tree.sh',
+ 't5000-tar-tree.sh',
+ 't5001-archive-attr.sh',
+ 't5002-archive-attr-pattern.sh',
+ 't5003-archive-zip.sh',
+ 't5004-archive-corner-cases.sh',
+ 't5100-mailinfo.sh',
+ 't5150-request-pull.sh',
+ 't5200-update-server-info.sh',
+ 't5300-pack-object.sh',
+ 't5301-sliding-window.sh',
+ 't5302-pack-index.sh',
+ 't5303-pack-corruption-resilience.sh',
+ 't5304-prune.sh',
+ 't5305-include-tag.sh',
+ 't5306-pack-nobase.sh',
+ 't5307-pack-missing-commit.sh',
+ 't5308-pack-detect-duplicates.sh',
+ 't5309-pack-delta-cycles.sh',
+ 't5310-pack-bitmaps.sh',
+ 't5311-pack-bitmaps-shallow.sh',
+ 't5312-prune-corruption.sh',
+ 't5313-pack-bounds-checks.sh',
+ 't5314-pack-cycle-detection.sh',
+ 't5315-pack-objects-compression.sh',
+ 't5316-pack-delta-depth.sh',
+ 't5317-pack-objects-filter-objects.sh',
+ 't5318-commit-graph.sh',
+ 't5319-multi-pack-index.sh',
+ 't5320-delta-islands.sh',
+ 't5321-pack-large-objects.sh',
+ 't5322-pack-objects-sparse.sh',
+ 't5323-pack-redundant.sh',
+ 't5324-split-commit-graph.sh',
+ 't5325-reverse-index.sh',
+ 't5326-multi-pack-bitmaps.sh',
+ 't5327-multi-pack-bitmaps-rev.sh',
+ 't5328-commit-graph-64bit-time.sh',
+ 't5329-pack-objects-cruft.sh',
+ 't5330-no-lazy-fetch-with-commit-graph.sh',
+ 't5331-pack-objects-stdin.sh',
+ 't5332-multi-pack-reuse.sh',
+ 't5333-pseudo-merge-bitmaps.sh',
+ 't5334-incremental-multi-pack-index.sh',
+ 't5351-unpack-large-objects.sh',
+ 't5400-send-pack.sh',
+ 't5401-update-hooks.sh',
+ 't5402-post-merge-hook.sh',
+ 't5403-post-checkout-hook.sh',
+ 't5404-tracking-branches.sh',
+ 't5405-send-pack-rewind.sh',
+ 't5406-remote-rejects.sh',
+ 't5407-post-rewrite-hook.sh',
+ 't5408-send-pack-stdin.sh',
+ 't5409-colorize-remote-messages.sh',
+ 't5410-receive-pack-alternates.sh',
+ 't5411-proc-receive-hook.sh',
+ 't5500-fetch-pack.sh',
+ 't5501-fetch-push-alternates.sh',
+ 't5502-quickfetch.sh',
+ 't5503-tagfollow.sh',
+ 't5504-fetch-receive-strict.sh',
+ 't5505-remote.sh',
+ 't5506-remote-groups.sh',
+ 't5507-remote-environment.sh',
+ 't5509-fetch-push-namespaces.sh',
+ 't5510-fetch.sh',
+ 't5511-refspec.sh',
+ 't5512-ls-remote.sh',
+ 't5513-fetch-track.sh',
+ 't5514-fetch-multiple.sh',
+ 't5515-fetch-merge-logic.sh',
+ 't5516-fetch-push.sh',
+ 't5517-push-mirror.sh',
+ 't5518-fetch-exit-status.sh',
+ 't5519-push-alternates.sh',
+ 't5520-pull.sh',
+ 't5521-pull-options.sh',
+ 't5522-pull-symlink.sh',
+ 't5523-push-upstream.sh',
+ 't5524-pull-msg.sh',
+ 't5525-fetch-tagopt.sh',
+ 't5526-fetch-submodules.sh',
+ 't5527-fetch-odd-refs.sh',
+ 't5528-push-default.sh',
+ 't5529-push-errors.sh',
+ 't5530-upload-pack-error.sh',
+ 't5531-deep-submodule-push.sh',
+ 't5532-fetch-proxy.sh',
+ 't5533-push-cas.sh',
+ 't5534-push-signed.sh',
+ 't5535-fetch-push-symref.sh',
+ 't5536-fetch-conflicts.sh',
+ 't5537-fetch-shallow.sh',
+ 't5538-push-shallow.sh',
+ 't5539-fetch-http-shallow.sh',
+ 't5540-http-push-webdav.sh',
+ 't5541-http-push-smart.sh',
+ 't5542-push-http-shallow.sh',
+ 't5543-atomic-push.sh',
+ 't5544-pack-objects-hook.sh',
+ 't5545-push-options.sh',
+ 't5546-receive-limits.sh',
+ 't5547-push-quarantine.sh',
+ 't5548-push-porcelain.sh',
+ 't5549-fetch-push-http.sh',
+ 't5550-http-fetch-dumb.sh',
+ 't5551-http-fetch-smart.sh',
+ 't5552-skipping-fetch-negotiator.sh',
+ 't5553-set-upstream.sh',
+ 't5554-noop-fetch-negotiator.sh',
+ 't5555-http-smart-common.sh',
+ 't5557-http-get.sh',
+ 't5558-clone-bundle-uri.sh',
+ 't5559-http-fetch-smart-http2.sh',
+ 't5560-http-backend-noserver.sh',
+ 't5561-http-backend.sh',
+ 't5562-http-backend-content-length.sh',
+ 't5563-simple-http-auth.sh',
+ 't5564-http-proxy.sh',
+ 't5570-git-daemon.sh',
+ 't5571-pre-push-hook.sh',
+ 't5572-pull-submodule.sh',
+ 't5573-pull-verify-signatures.sh',
+ 't5574-fetch-output.sh',
+ 't5580-unc-paths.sh',
+ 't5581-http-curl-verbose.sh',
+ 't5582-fetch-negative-refspec.sh',
+ 't5583-push-branches.sh',
+ 't5600-clone-fail-cleanup.sh',
+ 't5601-clone.sh',
+ 't5602-clone-remote-exec.sh',
+ 't5603-clone-dirname.sh',
+ 't5604-clone-reference.sh',
+ 't5605-clone-local.sh',
+ 't5606-clone-options.sh',
+ 't5607-clone-bundle.sh',
+ 't5608-clone-2gb.sh',
+ 't5609-clone-branch.sh',
+ 't5610-clone-detached.sh',
+ 't5611-clone-config.sh',
+ 't5612-clone-refspec.sh',
+ 't5613-info-alternate.sh',
+ 't5614-clone-submodules-shallow.sh',
+ 't5615-alternate-env.sh',
+ 't5616-partial-clone.sh',
+ 't5617-clone-submodules-remote.sh',
+ 't5618-alternate-refs.sh',
+ 't5619-clone-local-ambiguous-transport.sh',
+ 't5700-protocol-v1.sh',
+ 't5701-git-serve.sh',
+ 't5702-protocol-v2.sh',
+ 't5703-upload-pack-ref-in-want.sh',
+ 't5704-protocol-violations.sh',
+ 't5705-session-id-in-capabilities.sh',
+ 't5730-protocol-v2-bundle-uri-file.sh',
+ 't5731-protocol-v2-bundle-uri-git.sh',
+ 't5732-protocol-v2-bundle-uri-http.sh',
+ 't5750-bundle-uri-parse.sh',
+ 't5801-remote-helpers.sh',
+ 't5802-connect-helper.sh',
+ 't5810-proto-disable-local.sh',
+ 't5811-proto-disable-git.sh',
+ 't5812-proto-disable-http.sh',
+ 't5813-proto-disable-ssh.sh',
+ 't5814-proto-disable-ext.sh',
+ 't5815-submodule-protos.sh',
+ 't5900-repo-selection.sh',
+ 't6000-rev-list-misc.sh',
+ 't6001-rev-list-graft.sh',
+ 't6002-rev-list-bisect.sh',
+ 't6003-rev-list-topo-order.sh',
+ 't6004-rev-list-path-optim.sh',
+ 't6005-rev-list-count.sh',
+ 't6006-rev-list-format.sh',
+ 't6007-rev-list-cherry-pick-file.sh',
+ 't6008-rev-list-submodule.sh',
+ 't6009-rev-list-parent.sh',
+ 't6010-merge-base.sh',
+ 't6011-rev-list-with-bad-commit.sh',
+ 't6012-rev-list-simplify.sh',
+ 't6013-rev-list-reverse-parents.sh',
+ 't6014-rev-list-all.sh',
+ 't6016-rev-list-graph-simplify-history.sh',
+ 't6017-rev-list-stdin.sh',
+ 't6018-rev-list-glob.sh',
+ 't6019-rev-list-ancestry-path.sh',
+ 't6020-bundle-misc.sh',
+ 't6021-rev-list-exclude-hidden.sh',
+ 't6022-rev-list-missing.sh',
+ 't6030-bisect-porcelain.sh',
+ 't6040-tracking-info.sh',
+ 't6041-bisect-submodule.sh',
+ 't6050-replace.sh',
+ 't6060-merge-index.sh',
+ 't6100-rev-list-in-order.sh',
+ 't6101-rev-parse-parents.sh',
+ 't6102-rev-list-unexpected-objects.sh',
+ 't6110-rev-list-sparse.sh',
+ 't6111-rev-list-treesame.sh',
+ 't6112-rev-list-filters-objects.sh',
+ 't6113-rev-list-bitmap-filters.sh',
+ 't6114-keep-packs.sh',
+ 't6115-rev-list-du.sh',
+ 't6120-describe.sh',
+ 't6130-pathspec-noglob.sh',
+ 't6131-pathspec-icase.sh',
+ 't6132-pathspec-exclude.sh',
+ 't6133-pathspec-rev-dwim.sh',
+ 't6134-pathspec-in-submodule.sh',
+ 't6135-pathspec-with-attrs.sh',
+ 't6136-pathspec-in-bare.sh',
+ 't6200-fmt-merge-msg.sh',
+ 't6300-for-each-ref.sh',
+ 't6301-for-each-ref-errors.sh',
+ 't6302-for-each-ref-filter.sh',
+ 't6400-merge-df.sh',
+ 't6401-merge-criss-cross.sh',
+ 't6402-merge-rename.sh',
+ 't6403-merge-file.sh',
+ 't6404-recursive-merge.sh',
+ 't6405-merge-symlinks.sh',
+ 't6406-merge-attr.sh',
+ 't6407-merge-binary.sh',
+ 't6408-merge-up-to-date.sh',
+ 't6409-merge-subtree.sh',
+ 't6411-merge-filemode.sh',
+ 't6412-merge-large-rename.sh',
+ 't6413-merge-crlf.sh',
+ 't6414-merge-rename-nocruft.sh',
+ 't6415-merge-dir-to-symlink.sh',
+ 't6416-recursive-corner-cases.sh',
+ 't6417-merge-ours-theirs.sh',
+ 't6418-merge-text-auto.sh',
+ 't6419-merge-ignorecase.sh',
+ 't6421-merge-partial-clone.sh',
+ 't6422-merge-rename-corner-cases.sh',
+ 't6423-merge-rename-directories.sh',
+ 't6424-merge-unrelated-index-changes.sh',
+ 't6425-merge-rename-delete.sh',
+ 't6426-merge-skip-unneeded-updates.sh',
+ 't6427-diff3-conflict-markers.sh',
+ 't6428-merge-conflicts-sparse.sh',
+ 't6429-merge-sequence-rename-caching.sh',
+ 't6430-merge-recursive.sh',
+ 't6431-merge-criscross.sh',
+ 't6432-merge-recursive-space-options.sh',
+ 't6433-merge-toplevel.sh',
+ 't6434-merge-recursive-rename-options.sh',
+ 't6435-merge-sparse.sh',
+ 't6436-merge-overwrite.sh',
+ 't6437-submodule-merge.sh',
+ 't6438-submodule-directory-file-conflicts.sh',
+ 't6439-merge-co-error-msgs.sh',
+ 't6500-gc.sh',
+ 't6501-freshen-objects.sh',
+ 't6600-test-reach.sh',
+ 't6601-path-walk.sh',
+ 't6700-tree-depth.sh',
+ 't7001-mv.sh',
+ 't7002-mv-sparse-checkout.sh',
+ 't7003-filter-branch.sh',
+ 't7004-tag.sh',
+ 't7005-editor.sh',
+ 't7006-pager.sh',
+ 't7007-show.sh',
+ 't7008-filter-branch-null-sha1.sh',
+ 't7010-setup.sh',
+ 't7011-skip-worktree-reading.sh',
+ 't7012-skip-worktree-writing.sh',
+ 't7030-verify-tag.sh',
+ 't7031-verify-tag-signed-ssh.sh',
+ 't7060-wtstatus.sh',
+ 't7061-wtstatus-ignore.sh',
+ 't7062-wtstatus-ignorecase.sh',
+ 't7063-status-untracked-cache.sh',
+ 't7064-wtstatus-pv2.sh',
+ 't7101-reset-empty-subdirs.sh',
+ 't7102-reset.sh',
+ 't7103-reset-bare.sh',
+ 't7104-reset-hard.sh',
+ 't7105-reset-patch.sh',
+ 't7106-reset-unborn-branch.sh',
+ 't7107-reset-pathspec-file.sh',
+ 't7110-reset-merge.sh',
+ 't7111-reset-table.sh',
+ 't7112-reset-submodule.sh',
+ 't7113-post-index-change-hook.sh',
+ 't7201-co.sh',
+ 't7300-clean.sh',
+ 't7301-clean-interactive.sh',
+ 't7400-submodule-basic.sh',
+ 't7401-submodule-summary.sh',
+ 't7402-submodule-rebase.sh',
+ 't7403-submodule-sync.sh',
+ 't7406-submodule-update.sh',
+ 't7407-submodule-foreach.sh',
+ 't7408-submodule-reference.sh',
+ 't7409-submodule-detached-work-tree.sh',
+ 't7411-submodule-config.sh',
+ 't7412-submodule-absorbgitdirs.sh',
+ 't7413-submodule-is-active.sh',
+ 't7414-submodule-mistakes.sh',
+ 't7416-submodule-dash-url.sh',
+ 't7417-submodule-path-url.sh',
+ 't7418-submodule-sparse-gitmodules.sh',
+ 't7419-submodule-set-branch.sh',
+ 't7420-submodule-set-url.sh',
+ 't7421-submodule-summary-add.sh',
+ 't7422-submodule-output.sh',
+ 't7423-submodule-symlinks.sh',
+ 't7424-submodule-mixed-ref-formats.sh',
+ 't7450-bad-git-dotfiles.sh',
+ 't7500-commit-template-squash-signoff.sh',
+ 't7501-commit-basic-functionality.sh',
+ 't7502-commit-porcelain.sh',
+ 't7503-pre-commit-and-pre-merge-commit-hooks.sh',
+ 't7504-commit-msg-hook.sh',
+ 't7505-prepare-commit-msg-hook.sh',
+ 't7506-status-submodule.sh',
+ 't7507-commit-verbose.sh',
+ 't7508-status.sh',
+ 't7509-commit-authorship.sh',
+ 't7510-signed-commit.sh',
+ 't7511-status-index.sh',
+ 't7512-status-help.sh',
+ 't7513-interpret-trailers.sh',
+ 't7514-commit-patch.sh',
+ 't7515-status-symlinks.sh',
+ 't7516-commit-races.sh',
+ 't7517-per-repo-email.sh',
+ 't7518-ident-corner-cases.sh',
+ 't7519-status-fsmonitor.sh',
+ 't7520-ignored-hook-warning.sh',
+ 't7521-ignored-mode.sh',
+ 't7524-commit-summary.sh',
+ 't7525-status-rename.sh',
+ 't7526-commit-pathspec-file.sh',
+ 't7527-builtin-fsmonitor.sh',
+ 't7528-signed-commit-ssh.sh',
+ 't7600-merge.sh',
+ 't7601-merge-pull-config.sh',
+ 't7602-merge-octopus-many.sh',
+ 't7603-merge-reduce-heads.sh',
+ 't7604-merge-custom-message.sh',
+ 't7605-merge-resolve.sh',
+ 't7606-merge-custom.sh',
+ 't7607-merge-state.sh',
+ 't7608-merge-messages.sh',
+ 't7609-mergetool--lib.sh',
+ 't7610-mergetool.sh',
+ 't7611-merge-abort.sh',
+ 't7612-merge-verify-signatures.sh',
+ 't7614-merge-signoff.sh',
+ 't7615-diff-algo-with-mergy-operations.sh',
+ 't7700-repack.sh',
+ 't7701-repack-unpack-unreachable.sh',
+ 't7702-repack-cyclic-alternate.sh',
+ 't7703-repack-geometric.sh',
+ 't7704-repack-cruft.sh',
+ 't7800-difftool.sh',
+ 't7810-grep.sh',
+ 't7811-grep-open.sh',
+ 't7812-grep-icase-non-ascii.sh',
+ 't7813-grep-icase-iso.sh',
+ 't7814-grep-recurse-submodules.sh',
+ 't7815-grep-binary.sh',
+ 't7816-grep-binary-pattern.sh',
+ 't7817-grep-sparse-checkout.sh',
+ 't7900-maintenance.sh',
+ 't8001-annotate.sh',
+ 't8002-blame.sh',
+ 't8003-blame-corner-cases.sh',
+ 't8004-blame-with-conflicts.sh',
+ 't8005-blame-i18n.sh',
+ 't8006-blame-textconv.sh',
+ 't8007-cat-file-textconv.sh',
+ 't8008-blame-formats.sh',
+ 't8009-blame-vs-topicbranches.sh',
+ 't8010-cat-file-filters.sh',
+ 't8011-blame-split-file.sh',
+ 't8012-blame-colors.sh',
+ 't8013-blame-ignore-revs.sh',
+ 't8014-blame-ignore-fuzzy.sh',
+ 't9001-send-email.sh',
+ 't9002-column.sh',
+ 't9003-help-autocorrect.sh',
+ 't9100-git-svn-basic.sh',
+ 't9101-git-svn-props.sh',
+ 't9102-git-svn-deep-rmdir.sh',
+ 't9103-git-svn-tracked-directory-removed.sh',
+ 't9104-git-svn-follow-parent.sh',
+ 't9105-git-svn-commit-diff.sh',
+ 't9106-git-svn-commit-diff-clobber.sh',
+ 't9107-git-svn-migrate.sh',
+ 't9108-git-svn-glob.sh',
+ 't9109-git-svn-multi-glob.sh',
+ 't9110-git-svn-use-svm-props.sh',
+ 't9111-git-svn-use-svnsync-props.sh',
+ 't9112-git-svn-md5less-file.sh',
+ 't9113-git-svn-dcommit-new-file.sh',
+ 't9114-git-svn-dcommit-merge.sh',
+ 't9115-git-svn-dcommit-funky-renames.sh',
+ 't9116-git-svn-log.sh',
+ 't9117-git-svn-init-clone.sh',
+ 't9118-git-svn-funky-branch-names.sh',
+ 't9119-git-svn-info.sh',
+ 't9120-git-svn-clone-with-percent-escapes.sh',
+ 't9121-git-svn-fetch-renamed-dir.sh',
+ 't9122-git-svn-author.sh',
+ 't9123-git-svn-rebuild-with-rewriteroot.sh',
+ 't9124-git-svn-dcommit-auto-props.sh',
+ 't9125-git-svn-multi-glob-branch-names.sh',
+ 't9126-git-svn-follow-deleted-readded-directory.sh',
+ 't9127-git-svn-partial-rebuild.sh',
+ 't9128-git-svn-cmd-branch.sh',
+ 't9129-git-svn-i18n-commitencoding.sh',
+ 't9130-git-svn-authors-file.sh',
+ 't9131-git-svn-empty-symlink.sh',
+ 't9132-git-svn-broken-symlink.sh',
+ 't9133-git-svn-nested-git-repo.sh',
+ 't9134-git-svn-ignore-paths.sh',
+ 't9135-git-svn-moved-branch-empty-file.sh',
+ 't9136-git-svn-recreated-branch-empty-file.sh',
+ 't9137-git-svn-dcommit-clobber-series.sh',
+ 't9138-git-svn-authors-prog.sh',
+ 't9139-git-svn-non-utf8-commitencoding.sh',
+ 't9140-git-svn-reset.sh',
+ 't9141-git-svn-multiple-branches.sh',
+ 't9142-git-svn-shallow-clone.sh',
+ 't9143-git-svn-gc.sh',
+ 't9144-git-svn-old-rev_map.sh',
+ 't9145-git-svn-master-branch.sh',
+ 't9146-git-svn-empty-dirs.sh',
+ 't9147-git-svn-include-paths.sh',
+ 't9148-git-svn-propset.sh',
+ 't9150-svk-mergetickets.sh',
+ 't9151-svn-mergeinfo.sh',
+ 't9152-svn-empty-dirs-after-gc.sh',
+ 't9153-git-svn-rewrite-uuid.sh',
+ 't9154-git-svn-fancy-glob.sh',
+ 't9155-git-svn-fetch-deleted-tag.sh',
+ 't9156-git-svn-fetch-deleted-tag-2.sh',
+ 't9157-git-svn-fetch-merge.sh',
+ 't9158-git-svn-mergeinfo.sh',
+ 't9159-git-svn-no-parent-mergeinfo.sh',
+ 't9160-git-svn-preserve-empty-dirs.sh',
+ 't9161-git-svn-mergeinfo-push.sh',
+ 't9162-git-svn-dcommit-interactive.sh',
+ 't9163-git-svn-reset-clears-caches.sh',
+ 't9164-git-svn-dcommit-concurrent.sh',
+ 't9165-git-svn-fetch-merge-branch-of-branch.sh',
+ 't9166-git-svn-fetch-merge-branch-of-branch2.sh',
+ 't9167-git-svn-cmd-branch-subproject.sh',
+ 't9168-git-svn-partially-globbed-names.sh',
+ 't9169-git-svn-dcommit-crlf.sh',
+ 't9200-git-cvsexportcommit.sh',
+ 't9210-scalar.sh',
+ 't9211-scalar-clone.sh',
+ 't9300-fast-import.sh',
+ 't9301-fast-import-notes.sh',
+ 't9302-fast-import-unpack-limit.sh',
+ 't9303-fast-import-compression.sh',
+ 't9304-fast-import-marks.sh',
+ 't9350-fast-export.sh',
+ 't9351-fast-export-anonymize.sh',
+ 't9400-git-cvsserver-server.sh',
+ 't9401-git-cvsserver-crlf.sh',
+ 't9402-git-cvsserver-refs.sh',
+ 't9500-gitweb-standalone-no-errors.sh',
+ 't9501-gitweb-standalone-http-status.sh',
+ 't9502-gitweb-standalone-parse-output.sh',
+ 't9600-cvsimport.sh',
+ 't9601-cvsimport-vendor-branch.sh',
+ 't9602-cvsimport-branches-tags.sh',
+ 't9603-cvsimport-patchsets.sh',
+ 't9604-cvsimport-timestamps.sh',
+ 't9700-perl-git.sh',
+ 't9800-git-p4-basic.sh',
+ 't9801-git-p4-branch.sh',
+ 't9802-git-p4-filetype.sh',
+ 't9803-git-p4-shell-metachars.sh',
+ 't9804-git-p4-label.sh',
+ 't9805-git-p4-skip-submit-edit.sh',
+ 't9806-git-p4-options.sh',
+ 't9807-git-p4-submit.sh',
+ 't9808-git-p4-chdir.sh',
+ 't9809-git-p4-client-view.sh',
+ 't9810-git-p4-rcs.sh',
+ 't9811-git-p4-label-import.sh',
+ 't9812-git-p4-wildcards.sh',
+ 't9813-git-p4-preserve-users.sh',
+ 't9814-git-p4-rename.sh',
+ 't9815-git-p4-submit-fail.sh',
+ 't9816-git-p4-locked.sh',
+ 't9817-git-p4-exclude.sh',
+ 't9818-git-p4-block.sh',
+ 't9819-git-p4-case-folding.sh',
+ 't9820-git-p4-editor-handling.sh',
+ 't9821-git-p4-path-variations.sh',
+ 't9822-git-p4-path-encoding.sh',
+ 't9823-git-p4-mock-lfs.sh',
+ 't9824-git-p4-git-lfs.sh',
+ 't9825-git-p4-handle-utf16-without-bom.sh',
+ 't9826-git-p4-keep-empty-commits.sh',
+ 't9827-git-p4-change-filetype.sh',
+ 't9828-git-p4-map-user.sh',
+ 't9829-git-p4-jobs.sh',
+ 't9830-git-p4-symlink-dir.sh',
+ 't9831-git-p4-triggers.sh',
+ 't9832-unshelve.sh',
+ 't9833-errors.sh',
+ 't9834-git-p4-file-dir-bug.sh',
+ 't9835-git-p4-metadata-encoding-python2.sh',
+ 't9836-git-p4-metadata-encoding-python3.sh',
+ 't9850-shell.sh',
+ 't9901-git-web--browse.sh',
+ 't9902-completion.sh',
+ 't9903-bash-prompt.sh',
+]
+
+# Sanity check that we are not missing any tests present in 't/'. This check
+# only runs once at configure time and is thus best-effort, only. It is
+# sufficient to catch missing test suites in our CI though.
+foreach glob, tests : {
+ 't[0-9][0-9][0-9][0-9]-*.sh': integration_tests,
+ 'unit-tests/t-*.c': unit_test_programs,
+ 'unit-tests/u-*.c': clar_test_suites,
+}
+ actual_tests = run_command(shell, '-c', 'ls ' + glob,
+ check: true,
+ env: script_environment,
+ ).stdout().strip().split('\n')
+
+ if tests != actual_tests
+ missing_tests = [ ]
+ foreach actual_test : actual_tests
+ if actual_test not in tests
+ missing_tests += actual_test
+ endif
+ endforeach
+ if missing_tests.length() > 0
+ error('Test files found, but not configured:\n\n - ' + '\n - '.join(missing_tests))
+ endif
+
+ superfluous_tests = [ ]
+ foreach integration_test : tests
+ if integration_test not in actual_tests
+ superfluous_tests += integration_test
+ endif
+ endforeach
+ if superfluous_tests.length() > 0
+ error('Test files configured, but not found:\n\n - ' + '\n - '.join(superfluous_tests))
+ endif
+ endif
+endforeach
+
+# GIT_BUILD_DIR needs to be Unix-style without drive prefixes as it get added
+# to the PATH variable. And given that drive prefixes contain a colon we'd
+# otherwise end up with a broken PATH if we didn't convert it.
+git_build_dir = meson.project_build_root()
+if cygpath.found()
+ git_build_dir = run_command(cygpath, git_build_dir, check: true).stdout().strip()
+endif
+
+test_environment = script_environment
+test_environment.set('GIT_BUILD_DIR', git_build_dir)
+
+foreach integration_test : integration_tests
+ test(fs.stem(integration_test), shell,
+ args: [ integration_test ],
+ workdir: meson.current_source_dir(),
+ env: test_environment,
+ depends: test_dependencies + bin_wrappers,
+ timeout: 0,
+ )
+endforeach
diff --git a/t/perf/p6100-describe.sh b/t/perf/p6100-describe.sh
new file mode 100755
index 0000000000..069f91ce49
--- /dev/null
+++ b/t/perf/p6100-describe.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='performance of git-describe'
+. ./perf-lib.sh
+
+test_perf_default_repo
+
+# clear out old tags and give us a known state
+test_expect_success 'set up tags' '
+ git for-each-ref --format="delete %(refname)" refs/tags >to-delete &&
+ git update-ref --stdin <to-delete &&
+ new=$(git rev-list -1000 HEAD | tail -n 1) &&
+ git tag -m new new $new &&
+ old=$(git rev-list HEAD | tail -n 1) &&
+ git tag -m old old $old
+'
+
+test_perf 'describe HEAD' '
+ git describe HEAD
+'
+
+test_perf 'describe HEAD with one max candidate' '
+ git describe --candidates=1 HEAD
+'
+
+test_perf 'describe HEAD with one tag' '
+ git describe --match=new HEAD
+'
+
+test_done
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 4890dff4b2..72a0c2e7d4 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -433,6 +433,12 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
sep_git_dir_worktree () {
test_when_finished "rm -rf mainwt linkwt seprepo" &&
git init mainwt &&
+ if test "relative" = $2
+ then
+ test_config -C mainwt worktree.useRelativePaths true
+ else
+ test_config -C mainwt worktree.useRelativePaths false
+ fi
test_commit -C mainwt gumby &&
git -C mainwt worktree add --detach ../linkwt &&
git -C "$1" init --separate-git-dir ../seprepo &&
@@ -441,12 +447,20 @@ sep_git_dir_worktree () {
test_cmp expect actual
}
-test_expect_success 're-init to move gitdir with linked worktrees' '
- sep_git_dir_worktree mainwt
+test_expect_success 're-init to move gitdir with linked worktrees (absolute)' '
+ sep_git_dir_worktree mainwt absolute
+'
+
+test_expect_success 're-init to move gitdir within linked worktree (absolute)' '
+ sep_git_dir_worktree linkwt absolute
+'
+
+test_expect_success 're-init to move gitdir with linked worktrees (relative)' '
+ sep_git_dir_worktree mainwt relative
'
-test_expect_success 're-init to move gitdir within linked worktree' '
- sep_git_dir_worktree linkwt
+test_expect_success 're-init to move gitdir within linked worktree (relative)' '
+ sep_git_dir_worktree linkwt relative
'
test_expect_success MINGW '.git hidden' '
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 1d273d91c2..d3a0967e9d 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -255,8 +255,9 @@ do
(
GIT_CEILING_DIRECTORIES=$(pwd) &&
export GIT_CEILING_DIRECTORIES &&
- test_expect_code 129 git -C sub $builtin -h >output 2>&1
+ test_expect_code 129 git -C sub $builtin -h >output 2>err
) &&
+ test_must_be_empty err &&
test_grep usage output
'
done <builtins
diff --git a/t/t0018-advice.sh b/t/t0018-advice.sh
index 9a3db02fde..f68e08d0b1 100755
--- a/t/t0018-advice.sh
+++ b/t/t0018-advice.sh
@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
test_expect_success 'advice should be printed when config variable is unset' '
cat >expect <<-\EOF &&
hint: This is a piece of advice
- hint: Disable this message with "git config advice.nestedTag false"
+ hint: Disable this message with "git config set advice.nestedTag false"
EOF
test-tool advise "This is a piece of advice" 2>actual &&
test_cmp expect actual
diff --git a/t/t0210-trace2-normal.sh b/t/t0210-trace2-normal.sh
index eff9a59dbd..4287ed3fbb 100755
--- a/t/t0210-trace2-normal.sh
+++ b/t/t0210-trace2-normal.sh
@@ -243,6 +243,15 @@ test_expect_success 'bug messages followed by BUG() are written to trace2' '
test_cmp expect actual
'
+test_expect_success 'a valueless true configuration variable is handled' '
+ test_when_finished "rm -f trace2.normal actual expect" &&
+ echo >expect &&
+ GIT_TRACE2="$(pwd)/trace2.normal" \
+ GIT_TRACE2_CONFIG_PARAMS=foo.true \
+ git -c foo.true config foo.true >actual &&
+ test_cmp expect actual
+'
+
sane_unset GIT_TRACE2_BRIEF
# Now test without environment variables and get all Trace2 settings
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index 17952e52d6..cb3a85c7ff 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -76,6 +76,10 @@ test_expect_success 'setup helper scripts' '
test -z "$pexpiry" || echo password_expiry_utc=$pexpiry
EOF
+ write_script git-credential-cntrl-in-username <<-\EOF &&
+ printf "username=\\007latrix Lestrange\\n"
+ EOF
+
PATH="$PWD:$PATH"
'
@@ -696,6 +700,19 @@ test_expect_success 'match percent-encoded values in username' '
EOF
'
+test_expect_success 'match percent-encoded values in hostname' '
+ test_config "credential.https://a%20b%20c/.helper" "$HELPER" &&
+ check fill <<-\EOF
+ url=https://a b c/
+ --
+ protocol=https
+ host=a b c
+ username=foo
+ password=bar
+ --
+ EOF
+'
+
test_expect_success 'fetch with multiple path components' '
test_unconfig credential.helper &&
test_config credential.https://example.com/foo/repo.git.helper "verbatim foo bar" &&
@@ -885,6 +902,22 @@ test_expect_success 'url parser rejects embedded newlines' '
test_cmp expect stderr
'
+test_expect_success 'url parser rejects embedded carriage returns' '
+ test_config credential.helper "!true" &&
+ test_must_fail git credential fill 2>stderr <<-\EOF &&
+ url=https://example%0d.com/
+ EOF
+ cat >expect <<-\EOF &&
+ fatal: credential value for host contains carriage return
+ If this is intended, set `credential.protectProtocol=false`
+ EOF
+ test_cmp expect stderr &&
+ GIT_ASKPASS=true \
+ git -c credential.protectProtocol=false credential fill <<-\EOF
+ url=https://example%0d.com/
+ EOF
+'
+
test_expect_success 'host-less URLs are parsed as empty host' '
check fill "verbatim foo bar" <<-\EOF
url=cert:///path/to/cert.pem
@@ -994,4 +1027,20 @@ test_expect_success 'credential config with partial URLs' '
test_grep "skipping credential lookup for key" stderr
'
+BEL="$(printf '\007')"
+
+test_expect_success 'interactive prompt is sanitized' '
+ check fill cntrl-in-username <<-EOF
+ protocol=https
+ host=example.org
+ --
+ protocol=https
+ host=example.org
+ username=${BEL}latrix Lestrange
+ password=askpass-password
+ --
+ askpass: Password for ${SQ}https://%07latrix%20Lestrange@example.org${SQ}:
+ EOF
+'
+
test_done
diff --git a/t/t0411-clone-from-partial.sh b/t/t0411-clone-from-partial.sh
index c98d501869..196fc61784 100755
--- a/t/t0411-clone-from-partial.sh
+++ b/t/t0411-clone-from-partial.sh
@@ -28,7 +28,6 @@ test_expect_success 'local clone must not fetch from promisor remote and execute
test_must_fail git clone \
--upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
evil clone1 2>err &&
- test_grep "detected dubious ownership" err &&
test_grep ! "fake-upload-pack running" err &&
test_path_is_missing script-executed
'
@@ -38,7 +37,6 @@ test_expect_success 'clone from file://... must not fetch from promisor remote a
test_must_fail git clone \
--upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
"file://$(pwd)/evil" clone2 2>err &&
- test_grep "detected dubious ownership" err &&
test_grep ! "fake-upload-pack running" err &&
test_path_is_missing script-executed
'
@@ -48,7 +46,6 @@ test_expect_success 'fetch from file://... must not fetch from promisor remote a
test_must_fail git fetch \
--upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
"file://$(pwd)/evil" 2>err &&
- test_grep "detected dubious ownership" err &&
test_grep ! "fake-upload-pack running" err &&
test_path_is_missing script-executed
'
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index ff9bf213aa..398865d6eb 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -240,7 +240,8 @@ test_expect_success "setup" '
git config extensions.objectformat $test_hash_algo &&
git config extensions.compatobjectformat $test_compat_hash_algo &&
echo_without_newline "$hello_content" > hello &&
- git update-index --add hello
+ git update-index --add hello &&
+ git commit -m "add hello file"
'
run_blob_tests () {
@@ -602,6 +603,34 @@ test_expect_success FUNNYNAMES '--batch-check, -Z with newline in input' '
test_cmp expect actual
'
+test_expect_success 'setup with curly braches in input' '
+ git branch "foo{bar" HEAD &&
+ git branch "foo@" HEAD
+'
+
+test_expect_success 'object reference with curly brace' '
+ git cat-file -p "foo{bar:hello" >actual &&
+ git cat-file -p HEAD:hello >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'object reference with at-sign' '
+ git cat-file -p "foo@@{0}:hello" >actual &&
+ git cat-file -p HEAD:hello >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'setup with commit with colon' '
+ git commit-tree -m "testing: just a bunch of junk" HEAD^{tree} >out &&
+ git branch other $(cat out)
+'
+
+test_expect_success 'object reference via commit text search' '
+ git cat-file -p "other^{/testing:}:hello" >actual &&
+ git cat-file -p HEAD:hello >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'setup blobs which are likely to delta' '
test-tool genrandom foo 10240 >foo &&
{ cat foo && echo plus; } >foo-plus &&
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index e2316f1dd4..29045aad43 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -2068,4 +2068,13 @@ do
done
+test_expect_success 'update-ref should also create reflog for HEAD' '
+ test_commit to-rewind &&
+ git rev-parse HEAD >expect &&
+ head=$(git symbolic-ref HEAD) &&
+ git update-ref --create-reflog "$head" HEAD~ &&
+ git rev-parse HEAD@{1} >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index bf2a90df94..58a4583088 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -309,4 +309,19 @@ test_expect_success '--short= truncates to the actual hash length' '
test_cmp expect actual
'
+test_expect_success ':/ and HEAD^{/} favor more recent matching commits' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit common-old &&
+ test_commit --no-tag common-new &&
+ git rev-parse HEAD >expect &&
+ git rev-parse :/common >actual &&
+ test_cmp expect actual &&
+ git rev-parse HEAD^{/common} >actual &&
+ test_cmp expect actual
+ )
+'
+
test_done
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index ba320dc417..90638fa886 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -1206,4 +1206,50 @@ test_expect_success '"add" with initialized submodule, with submodule.recurse se
git -C project-clone -c submodule.recurse worktree add ../project-5
'
+test_expect_success 'can create worktrees with relative paths' '
+ test_when_finished "git worktree remove relative" &&
+ test_config worktree.useRelativePaths false &&
+ git worktree add --relative-paths ./relative &&
+ echo "gitdir: ../.git/worktrees/relative" >expect &&
+ test_cmp expect relative/.git &&
+ echo "../../../relative/.git" >expect &&
+ test_cmp expect .git/worktrees/relative/gitdir
+'
+
+test_expect_success 'can create worktrees with absolute paths' '
+ test_config worktree.useRelativePaths true &&
+ git worktree add ./relative &&
+ echo "gitdir: ../.git/worktrees/relative" >expect &&
+ test_cmp expect relative/.git &&
+ git worktree add --no-relative-paths ./absolute &&
+ echo "gitdir: $(pwd)/.git/worktrees/absolute" >expect &&
+ test_cmp expect absolute/.git &&
+ echo "$(pwd)/absolute/.git" >expect &&
+ test_cmp expect .git/worktrees/absolute/gitdir
+'
+
+test_expect_success 'move repo without breaking relative internal links' '
+ test_when_finished rm -rf repo moved &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit initial &&
+ git worktree add --relative-paths wt1 &&
+ cd .. &&
+ mv repo moved &&
+ cd moved/wt1 &&
+ git worktree list >out 2>err &&
+ test_must_be_empty err
+ )
+'
+
+test_expect_success 'relative worktree sets extension config' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ git -C repo commit --allow-empty -m base &&
+ git -C repo worktree add --relative-paths ./foo &&
+ test_cmp_config -C repo 1 core.repositoryformatversion &&
+ test_cmp_config -C repo true extensions.relativeworktrees
+'
+
test_done
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index aa5b42c0f7..fe671d4197 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -119,11 +119,12 @@ test_expect_success 'prune duplicate (main/linked)' '
! test -d .git/worktrees/wt
'
-test_expect_success 'not prune proper worktrees when run inside linked worktree' '
+test_expect_success 'not prune proper worktrees inside linked worktree with relative paths' '
test_when_finished rm -rf repo wt_ext &&
git init repo &&
(
cd repo &&
+ git config worktree.useRelativePaths true &&
echo content >file &&
git add file &&
git commit -m msg &&
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index cb125ec226..8ef1cad7f2 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -260,6 +260,7 @@ test_expect_success 'broken main worktree still at the top' '
'
test_expect_success 'linked worktrees are sorted' '
+ test_when_finished "rm -rf sorted" &&
mkdir sorted &&
git init sorted/main &&
(
@@ -279,6 +280,27 @@ test_expect_success 'linked worktrees are sorted' '
test_cmp expected sorted/main/actual
'
+test_expect_success 'linked worktrees with relative paths are shown with absolute paths' '
+ test_when_finished "rm -rf sorted" &&
+ mkdir sorted &&
+ git init sorted/main &&
+ (
+ cd sorted/main &&
+ test_tick &&
+ test_commit new &&
+ git worktree add --relative-paths ../first &&
+ git worktree add ../second &&
+ git worktree list --porcelain >out &&
+ grep ^worktree out >actual
+ ) &&
+ cat >expected <<-EOF &&
+ worktree $(pwd)/sorted/main
+ worktree $(pwd)/sorted/first
+ worktree $(pwd)/sorted/second
+ EOF
+ test_cmp expected sorted/main/actual
+'
+
test_expect_success 'worktree path when called in .git directory' '
git worktree list >list1 &&
git -C .git worktree list >list2 &&
diff --git a/t/t2403-worktree-move.sh b/t/t2403-worktree-move.sh
index 08531deb5b..0bb33e8b1b 100755
--- a/t/t2403-worktree-move.sh
+++ b/t/t2403-worktree-move.sh
@@ -246,4 +246,29 @@ test_expect_success 'not remove a repo with initialized submodule' '
)
'
+test_expect_success 'move worktree with absolute path to relative path' '
+ test_config worktree.useRelativePaths false &&
+ git worktree add ./absolute &&
+ git worktree move --relative-paths absolute relative &&
+ echo "gitdir: ../.git/worktrees/absolute" >expect &&
+ test_cmp expect relative/.git &&
+ echo "../../../relative/.git" >expect &&
+ test_cmp expect .git/worktrees/absolute/gitdir &&
+ test_config worktree.useRelativePaths true &&
+ git worktree move relative relative2 &&
+ echo "gitdir: ../.git/worktrees/absolute" >expect &&
+ test_cmp expect relative2/.git &&
+ echo "../../../relative2/.git" >expect &&
+ test_cmp expect .git/worktrees/absolute/gitdir
+'
+
+test_expect_success 'move worktree with relative path to absolute path' '
+ test_config worktree.useRelativePaths true &&
+ git worktree move --no-relative-paths relative2 absolute &&
+ echo "gitdir: $(pwd)/.git/worktrees/absolute" >expect &&
+ test_cmp expect absolute/.git &&
+ echo "$(pwd)/absolute/.git" >expect &&
+ test_cmp expect .git/worktrees/absolute/gitdir
+'
+
test_done
diff --git a/t/t2406-worktree-repair.sh b/t/t2406-worktree-repair.sh
index bf340b8772..f5f19b3169 100755
--- a/t/t2406-worktree-repair.sh
+++ b/t/t2406-worktree-repair.sh
@@ -215,4 +215,43 @@ test_expect_success 'repair copied main and linked worktrees' '
test_cmp dup/linked.expect dup/linked/.git
'
+test_expect_success 'repair worktree with relative path with missing gitfile' '
+ test_when_finished "rm -rf main wt" &&
+ test_create_repo main &&
+ git -C main config worktree.useRelativePaths true &&
+ test_commit -C main init &&
+ git -C main worktree add --detach ../wt &&
+ rm wt/.git &&
+ test_path_is_missing wt/.git &&
+ git -C main worktree repair &&
+ echo "gitdir: ../main/.git/worktrees/wt" >expect &&
+ test_cmp expect wt/.git
+'
+
+test_expect_success 'repair absolute worktree to use relative paths' '
+ test_when_finished "rm -rf main side sidemoved" &&
+ test_create_repo main &&
+ test_commit -C main init &&
+ git -C main worktree add --detach ../side &&
+ echo "../../../../sidemoved/.git" >expect-gitdir &&
+ echo "gitdir: ../main/.git/worktrees/side" >expect-gitfile &&
+ mv side sidemoved &&
+ git -C main worktree repair --relative-paths ../sidemoved &&
+ test_cmp expect-gitdir main/.git/worktrees/side/gitdir &&
+ test_cmp expect-gitfile sidemoved/.git
+'
+
+test_expect_success 'repair relative worktree to use absolute paths' '
+ test_when_finished "rm -rf main side sidemoved" &&
+ test_create_repo main &&
+ test_commit -C main init &&
+ git -C main worktree add --relative-paths --detach ../side &&
+ echo "$(pwd)/sidemoved/.git" >expect-gitdir &&
+ echo "gitdir: $(pwd)/main/.git/worktrees/side" >expect-gitfile &&
+ mv side sidemoved &&
+ git -C main worktree repair ../sidemoved &&
+ test_cmp expect-gitdir main/.git/worktrees/side/gitdir &&
+ test_cmp expect-gitfile sidemoved/.git
+'
+
test_done
diff --git a/t/t2408-worktree-relative.sh b/t/t2408-worktree-relative.sh
deleted file mode 100755
index d51cc8c5ab..0000000000
--- a/t/t2408-worktree-relative.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-test_description='test worktrees linked with relative paths'
-
-. ./test-lib.sh
-
-test_expect_success 'links worktrees with relative paths' '
- test_when_finished rm -rf repo &&
- git init repo &&
- (
- cd repo &&
- test_commit initial &&
- git worktree add wt1 &&
- echo "../../../wt1/.git" >expected_gitdir &&
- cat .git/worktrees/wt1/gitdir >actual_gitdir &&
- echo "gitdir: ../.git/worktrees/wt1" >expected_git &&
- cat wt1/.git >actual_git &&
- test_cmp expected_gitdir actual_gitdir &&
- test_cmp expected_git actual_git
- )
-'
-
-test_expect_success 'move repo without breaking relative internal links' '
- test_when_finished rm -rf repo moved &&
- git init repo &&
- (
- cd repo &&
- test_commit initial &&
- git worktree add wt1 &&
- cd .. &&
- mv repo moved &&
- cd moved/wt1 &&
- git status >out 2>err &&
- test_must_be_empty err
- )
-'
-
-test_done
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 2295db3dcb..a3a21c54cf 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -1696,7 +1696,7 @@ test_expect_success 'errors if given a bad branch name' '
cat <<-\EOF >expect &&
fatal: '\''foo..bar'\'' is not a valid branch name
hint: See `man git check-ref-format`
- hint: Disable this message with "git config advice.refSyntax false"
+ hint: Disable this message with "git config set advice.refSyntax false"
EOF
test_must_fail git branch foo..bar >actual 2>&1 &&
test_cmp expect actual
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 500c9d0e72..a6bd88a58d 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -368,6 +368,34 @@ test_expect_success 'git branch --format with ahead-behind' '
test_cmp expect actual
'
+test_expect_success 'git branch `--sort=[-]ahead-behind` option' '
+ cat >expect <<-\EOF &&
+ (HEAD detached from fromtag) 0 0
+ refs/heads/ambiguous 0 0
+ refs/heads/branch-two 0 0
+ refs/heads/branch-one 1 0
+ refs/heads/main 1 0
+ refs/heads/ref-to-branch 1 0
+ refs/heads/ref-to-remote 1 0
+ EOF
+ git branch --format="%(refname) %(ahead-behind:HEAD)" \
+ --sort=refname --sort=ahead-behind:HEAD >actual &&
+ test_cmp expect actual &&
+
+ cat >expect <<-\EOF &&
+ (HEAD detached from fromtag) 0 0
+ refs/heads/branch-one 1 0
+ refs/heads/main 1 0
+ refs/heads/ref-to-branch 1 0
+ refs/heads/ref-to-remote 1 0
+ refs/heads/ambiguous 0 0
+ refs/heads/branch-two 0 0
+ EOF
+ git branch --format="%(refname) %(ahead-behind:HEAD)" \
+ --sort=refname --sort=-ahead-behind:HEAD >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'git branch with --format=%(rest) must fail' '
test_must_fail git branch --format="%(rest)" >actual
'
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index d2ca43d6aa..e091df6d01 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -908,4 +908,20 @@ test_expect_success 'submodule changes are shown irrespective of diff.submodule'
test_cmp expect actual
'
+test_expect_success '--diff-merges' '
+ renamed_oid=$(git rev-parse --short renamed-file) &&
+ tree=$(git merge-tree unmodified renamed-file) &&
+ clean=$(git commit-tree -m merge -p unmodified -p renamed-file $tree) &&
+ clean_oid=$(git rev-parse --short $clean) &&
+ conflict=$(git commit-tree -m merge -p unmodified -p renamed-file^ $tree) &&
+ conflict_oid=$(git rev-parse --short $conflict) &&
+
+ git range-diff --diff-merges=1 $clean...$conflict >actual &&
+ cat >expect <<-EOF &&
+ 1: $renamed_oid < -: ------- s/12/B/
+ 2: $clean_oid = 1: $conflict_oid merge
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index b11f04eb33..ecfc02062c 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -2258,20 +2258,20 @@ test_expect_success 'non-merge commands reject merge commits' '
error: ${SQ}pick${SQ} does not accept merge commits
hint: ${SQ}pick${SQ} does not take a merge commit. If you wanted to
hint: replay the merge, use ${SQ}merge -C${SQ} on the commit.
- hint: Disable this message with "git config advice.rebaseTodoError false"
+ hint: Disable this message with "git config set advice.rebaseTodoError false"
error: invalid line 1: pick $oid
error: ${SQ}reword${SQ} does not accept merge commits
hint: ${SQ}reword${SQ} does not take a merge commit. If you wanted to
hint: replay the merge and reword the commit message, use
hint: ${SQ}merge -c${SQ} on the commit
- hint: Disable this message with "git config advice.rebaseTodoError false"
+ hint: Disable this message with "git config set advice.rebaseTodoError false"
error: invalid line 2: reword $oid
error: ${SQ}edit${SQ} does not accept merge commits
hint: ${SQ}edit${SQ} does not take a merge commit. If you wanted to
hint: replay the merge, use ${SQ}merge -C${SQ} on the commit, and then
hint: ${SQ}break${SQ} to give the control back to you so that you can
hint: do ${SQ}git commit --amend && git rebase --continue${SQ}.
- hint: Disable this message with "git config advice.rebaseTodoError false"
+ hint: Disable this message with "git config set advice.rebaseTodoError false"
error: invalid line 3: edit $oid
error: cannot squash merge commit into another commit
error: invalid line 4: fixup $oid
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 9e8c51b4e2..8025a28cfd 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -177,7 +177,7 @@ test_expect_success 'advice from failed revert' '
hint: You can instead skip this commit with "git revert --skip".
hint: To abort and get back to the state before "git revert",
hint: run "git revert --abort".
- hint: Disable this message with "git config advice.mergeConflict false"
+ hint: Disable this message with "git config set advice.mergeConflict false"
EOF
test_commit --append --no-tag "double-add dream" dream dream &&
test_must_fail git revert HEAD^ 2>actual &&
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index f3947b400a..44596cb1e8 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -34,7 +34,7 @@ test_expect_success setup '
git commit --allow-empty --allow-empty-message &&
git tag empty &&
git checkout main &&
- git config advice.detachedhead false
+ git config set advice.detachedhead false
'
@@ -60,7 +60,7 @@ test_expect_success 'advice from failed cherry-pick' '
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
- hint: Disable this message with "git config advice.mergeConflict false"
+ hint: Disable this message with "git config set advice.mergeConflict false"
EOF
test_must_fail git cherry-pick picked 2>actual &&
@@ -75,7 +75,7 @@ test_expect_success 'advice from failed cherry-pick --no-commit' "
error: could not apply \$picked... picked
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
- hint: Disable this message with \"git config advice.mergeConflict false\"
+ hint: Disable this message with \"git config set advice.mergeConflict false\"
EOF
test_must_fail git cherry-pick --no-commit picked 2>actual &&
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 7eb52b12ed..66ff9db270 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -25,7 +25,7 @@ pristine_detach () {
}
test_expect_success setup '
- git config advice.detachedhead false &&
+ git config set advice.detachedhead false &&
echo unrelated >unrelated &&
git add unrelated &&
test_commit initial foo a &&
diff --git a/t/t3511-cherry-pick-x.sh b/t/t3511-cherry-pick-x.sh
index 84a587daf3..98ef13f0a3 100755
--- a/t/t3511-cherry-pick-x.sh
+++ b/t/t3511-cherry-pick-x.sh
@@ -51,7 +51,7 @@ trailing empty lines
"
test_expect_success setup '
- git config advice.detachedhead false &&
+ git config set advice.detachedhead false &&
echo unrelated >unrelated &&
git add unrelated &&
test_commit initial foo a &&
diff --git a/t/t3602-rm-sparse-checkout.sh b/t/t3602-rm-sparse-checkout.sh
index 08580fd3dc..02c7acd617 100755
--- a/t/t3602-rm-sparse-checkout.sh
+++ b/t/t3602-rm-sparse-checkout.sh
@@ -20,7 +20,7 @@ test_expect_success 'setup' "
hint: If you intend to update such entries, try one of the following:
hint: * Use the --sparse option.
hint: * Disable or modify the sparsity rules.
- hint: Disable this message with \"git config advice.updateSparsePath false\"
+ hint: Disable this message with \"git config set advice.updateSparsePath false\"
EOF
echo b | cat sparse_error_header - >sparse_entry_b_error &&
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 4c543a1a7e..df580a5806 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -31,7 +31,7 @@ test_expect_success 'Test with no pathspecs' '
cat >expect <<-EOF &&
Nothing specified, nothing added.
hint: Maybe you wanted to say ${SQ}git add .${SQ}?
- hint: Disable this message with "git config advice.addEmptyPathspec false"
+ hint: Disable this message with "git config set advice.addEmptyPathspec false"
EOF
git add 2>actual &&
test_cmp expect actual
@@ -375,7 +375,7 @@ test_expect_success '"git add" a embedded repository' '
hint: git rm --cached inner1
hint:
hint: See "git help submodule" for more information.
- hint: Disable this message with "git config advice.addEmbeddedRepo false"
+ hint: Disable this message with "git config set advice.addEmbeddedRepo false"
warning: adding embedded git repository: inner2
EOF
test_cmp expect actual
@@ -413,7 +413,7 @@ cat >expect.err <<\EOF
The following paths are ignored by one of your .gitignore files:
ignored-file
hint: Use -f if you really want to add them.
-hint: Disable this message with "git config advice.addIgnoredFile false"
+hint: Disable this message with "git config set advice.addIgnoredFile false"
EOF
cat >expect.out <<\EOF
add 'track-this'
diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
index 2bade9e804..53a4782267 100755
--- a/t/t3705-add-sparse-checkout.sh
+++ b/t/t3705-add-sparse-checkout.sh
@@ -54,7 +54,7 @@ test_expect_success 'setup' "
hint: If you intend to update such entries, try one of the following:
hint: * Use the --sparse option.
hint: * Disable or modify the sparsity rules.
- hint: Disable this message with \"git config advice.updateSparsePath false\"
+ hint: Disable this message with \"git config set advice.updateSparsePath false\"
EOF
echo sparse_entry | cat sparse_error_header - >sparse_entry_error &&
diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh
index ca8f999cab..c6c94aef14 100755
--- a/t/t4069-remerge-diff.sh
+++ b/t/t4069-remerge-diff.sh
@@ -352,4 +352,11 @@ test_expect_success 'remerge-diff turns off history simplification' '
test_cmp expect actual
'
+test_expect_success 'remerge-diff with --reverse' '
+ git log -1 --remerge-diff --oneline ab_resolution^ >expect &&
+ git log -1 --remerge-diff --oneline ab_resolution >>expect &&
+ git log -2 --remerge-diff --oneline ab_resolution --reverse >actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
index 0614511656..2e83cc820a 100755
--- a/t/t4207-log-decoration-colors.sh
+++ b/t/t4207-log-decoration-colors.sh
@@ -58,7 +58,8 @@ ${c_reset}${c_tag}tag: ${c_reset}${c_tag}v1.0${c_reset}${c_commit}, \
${c_reset}${c_tag}tag: ${c_reset}${c_tag}B${c_reset}${c_commit})${c_reset} B
${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}\
${c_tag}tag: ${c_reset}${c_tag}A1${c_reset}${c_commit}, \
-${c_reset}${c_remoteBranch}other/main${c_reset}${c_commit})${c_reset} A1
+${c_reset}${c_remoteBranch}other/main${c_reset}${c_commit}, \
+${c_reset}${c_remoteBranch}other/HEAD${c_reset}${c_commit})${c_reset} A1
${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}\
${c_stash}refs/stash${c_reset}${c_commit})${c_reset} On main: Changes to A.t
${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}\
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 53dc3cbf90..d1d6248558 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -525,6 +525,24 @@ test_expect_success 'index-pack --strict <pack> works in non-repo' '
test_path_is_file foo.idx
'
+test_expect_success SHA1 'show-index works OK outside a repository' '
+ nongit git show-index <foo.idx
+'
+
+for hash in sha1 sha256
+do
+ test_expect_success 'show-index works OK outside a repository with hash algo passed in via --object-format' '
+ test_when_finished "rm -rf explicit-hash-$hash" &&
+ git init --object-format=$hash explicit-hash-$hash &&
+ test_commit -C explicit-hash-$hash one &&
+ git -C explicit-hash-$hash rev-parse one >in &&
+ git -C explicit-hash-$hash pack-objects explicit-hash-$hash <in &&
+ idx=$(echo explicit-hash-$hash/explicit-hash-$hash*.idx) &&
+ nongit git show-index --object-format=$hash <"$idx" >actual &&
+ test_line_count = 1 actual
+ '
+done
+
test_expect_success !PTHREADS,!FAIL_PREREQS \
'index-pack --threads=N or pack.threads=N warns when no pthreads' '
test_must_fail git index-pack --threads=2 2>err &&
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 53dbc8ce3a..e273ab29c7 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -167,10 +167,12 @@ test_expect_success 'fsck with unsorted skipList' '
test_expect_success 'fsck with invalid or bogus skipList input' '
git -c fsck.skipList=/dev/null -c fsck.missingEmail=ignore fsck &&
+ test_must_fail git -c fsck.skipList -c fsck.missingEmail=ignore fsck 2>err &&
+ test_grep "unable to parse '\'fsck.skiplist\'' from command-line config" err &&
test_must_fail git -c fsck.skipList=does-not-exist -c fsck.missingEmail=ignore fsck 2>err &&
test_grep "could not open.*: does-not-exist" err &&
test_must_fail git -c fsck.skipList=.git/config -c fsck.missingEmail=ignore fsck 2>err &&
- test_grep "invalid object name: \[core\]" err
+ test_grep "invalid object name: " err
'
test_expect_success 'fsck with other accepted skipList input (comments & empty lines)' '
@@ -213,6 +215,11 @@ test_expect_success 'fsck with exhaustive accepted skipList input (various types
test_must_be_empty err
'
+test_expect_success 'receive-pack with missing receive.fsck.skipList path' '
+ test_must_fail git -c receive.fsck.skipList receive-pack dst 2>err &&
+ test_grep "unable to parse '\'receive.fsck.skiplist\'' from command-line config" err
+'
+
test_expect_success 'push with receive.fsck.skipList' '
git push . $commit:refs/heads/bogus &&
rm -rf dst &&
@@ -233,7 +240,7 @@ test_expect_success 'push with receive.fsck.skipList' '
test_grep "could not open.*: does-not-exist" err &&
git --git-dir=dst/.git config receive.fsck.skipList config &&
test_must_fail git push --porcelain dst bogus 2>err &&
- test_grep "invalid object name: \[core\]" err &&
+ test_grep "invalid object name: " err &&
git --git-dir=dst/.git config receive.fsck.skipList SKIP &&
git push --porcelain dst bogus
@@ -255,6 +262,9 @@ test_expect_success 'fetch with fetch.fsck.skipList' '
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
# Invalid and/or bogus skipList input
+ test_must_fail git --git-dir=dst/.git -c fetch.fsck.skipList fetch \
+ "file://$(pwd)" $refspec 2>err &&
+ test_grep "unable to parse '\'fetch.fsck.skiplist\'' from command-line config" err &&
git --git-dir=dst/.git config fetch.fsck.skipList /dev/null &&
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
git --git-dir=dst/.git config fetch.fsck.skipList does-not-exist &&
@@ -262,7 +272,7 @@ test_expect_success 'fetch with fetch.fsck.skipList' '
test_grep "could not open.*: does-not-exist" err &&
git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/config &&
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec 2>err &&
- test_grep "invalid object name: \[core\]" err &&
+ test_grep "invalid object name: " err &&
git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/SKIP &&
git --git-dir=dst/.git fetch "file://$(pwd)" $refspec
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 08424e878e..519f7973e3 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -2,6 +2,9 @@
test_description='git remote porcelain-ish'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
setup_repository () {
@@ -70,7 +73,7 @@ test_expect_success 'add another remote' '
cd test &&
git remote add -f second ../two &&
tokens_match "origin second" "$(git remote)" &&
- check_tracking_branch second main side another &&
+ check_tracking_branch second main side another HEAD &&
git for-each-ref "--format=%(refname)" refs/remotes |
sed -e "/^refs\/remotes\/origin\//d" \
-e "/^refs\/remotes\/second\//d" >actual &&
@@ -428,16 +431,90 @@ test_expect_success 'set-head --auto' '
)
'
+test_expect_success REFFILES 'set-head --auto failure' '
+ test_when_finished "rm -f test/.git/refs/remotes/origin/HEAD.lock" &&
+ (
+ cd test &&
+ touch .git/refs/remotes/origin/HEAD.lock &&
+ test_must_fail git remote set-head --auto origin 2>err &&
+ tail -n1 err >output &&
+ echo "error: Could not set up refs/remotes/origin/HEAD" >expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success 'set-head --auto detects creation' '
+ (
+ cd test &&
+ git update-ref --no-deref -d refs/remotes/origin/HEAD &&
+ git remote set-head --auto origin >output &&
+ echo "${SQ}origin/HEAD${SQ} is now created and points to ${SQ}main${SQ}" >expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success 'set-head --auto to update a non symbolic ref' '
+ (
+ cd test &&
+ git update-ref --no-deref -d refs/remotes/origin/HEAD &&
+ git update-ref refs/remotes/origin/HEAD HEAD &&
+ HEAD=$(git log --pretty="%H") &&
+ git remote set-head --auto origin >output &&
+ echo "${SQ}origin/HEAD${SQ} was detached at ${SQ}${HEAD}${SQ} and now points to ${SQ}main${SQ}" >expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success 'set-head --auto detects no change' '
+ (
+ cd test &&
+ git remote set-head --auto origin >output &&
+ echo "${SQ}origin/HEAD${SQ} is unchanged and points to ${SQ}main${SQ}" >expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success 'set-head --auto detects change' '
+ (
+ cd test &&
+ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/ahead &&
+ git remote set-head --auto origin >output &&
+ echo "${SQ}origin/HEAD${SQ} has changed from ${SQ}ahead${SQ} and now points to ${SQ}main${SQ}" >expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success 'set-head --auto detects strange ref' '
+ (
+ cd test &&
+ git symbolic-ref refs/remotes/origin/HEAD refs/heads/main &&
+ git remote set-head --auto origin >output &&
+ echo "${SQ}origin/HEAD${SQ} used to point to ${SQ}refs/heads/main${SQ} (which is not a remote branch), but now points to ${SQ}main${SQ}" >expect &&
+ test_cmp expect output
+ )
+'
+
test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
(
cd test &&
git fetch two "refs/heads/*:refs/remotes/two/*" &&
git remote set-head --auto two >output 2>&1 &&
- echo "two/HEAD set to main" >expect &&
+ echo "${SQ}two/HEAD${SQ} is unchanged and points to ${SQ}main${SQ}" >expect &&
test_cmp expect output
)
'
+test_expect_success 'set-head changes followRemoteHEAD always to warn' '
+ (
+ cd test &&
+ git config set remote.origin.followRemoteHEAD "always" &&
+ git remote set-head --auto origin &&
+ git config get remote.origin.followRemoteHEAD >actual &&
+ echo "warn" >expect &&
+ test_cmp expect actual
+ )
+'
+
cat >test/expect <<\EOF
refs/remotes/origin/side2
EOF
@@ -452,6 +529,16 @@ test_expect_success 'set-head explicit' '
)
'
+test_expect_success 'set-head --auto reports change' '
+ (
+ cd test &&
+ git remote set-head origin side2 &&
+ git remote set-head --auto origin >output 2>&1 &&
+ echo "${SQ}origin/HEAD${SQ} has changed from ${SQ}side2${SQ} and now points to ${SQ}main${SQ}" >expect &&
+ test_cmp expect output
+ )
+'
+
cat >test/expect <<EOF
Pruning origin
URL: $(pwd)/one
@@ -492,6 +579,16 @@ test_expect_success 'add --mirror && prune' '
)
'
+test_expect_success 'add --mirror setting HEAD' '
+ mkdir headmirror &&
+ (
+ cd headmirror &&
+ git init --bare -b notmain &&
+ git remote add --mirror -f origin ../one &&
+ test "$(git symbolic-ref HEAD)" = "refs/heads/main"
+ )
+'
+
test_expect_success 'add --mirror=fetch' '
mkdir mirror-fetch &&
git init -b main mirror-fetch/parent &&
@@ -711,8 +808,10 @@ test_expect_success 'reject --no-no-tags' '
'
cat >one/expect <<\EOF
+ apis/HEAD -> apis/main
apis/main
apis/side
+ drosophila/HEAD -> drosophila/main
drosophila/another
drosophila/main
drosophila/side
@@ -730,11 +829,14 @@ test_expect_success 'update' '
'
cat >one/expect <<\EOF
+ drosophila/HEAD -> drosophila/main
drosophila/another
drosophila/main
drosophila/side
+ manduca/HEAD -> manduca/main
manduca/main
manduca/side
+ megaloprepus/HEAD -> megaloprepus/main
megaloprepus/main
megaloprepus/side
EOF
@@ -742,7 +844,7 @@ EOF
test_expect_success 'update with arguments' '
(
cd one &&
- for b in $(git branch -r)
+ for b in $(git branch -r | grep -v HEAD)
do
git branch -r -d $b || exit 1
done &&
@@ -774,10 +876,13 @@ test_expect_success 'update --prune' '
'
cat >one/expect <<-\EOF
+ apis/HEAD -> apis/main
apis/main
apis/side
+ manduca/HEAD -> manduca/main
manduca/main
manduca/side
+ megaloprepus/HEAD -> megaloprepus/main
megaloprepus/main
megaloprepus/side
EOF
@@ -785,7 +890,7 @@ EOF
test_expect_success 'update default' '
(
cd one &&
- for b in $(git branch -r)
+ for b in $(git branch -r | grep -v HEAD)
do
git branch -r -d $b || exit 1
done &&
@@ -797,6 +902,7 @@ test_expect_success 'update default' '
'
cat >one/expect <<\EOF
+ drosophila/HEAD -> drosophila/main
drosophila/another
drosophila/main
drosophila/side
@@ -805,7 +911,7 @@ EOF
test_expect_success 'update default (overridden, with funny whitespace)' '
(
cd one &&
- for b in $(git branch -r)
+ for b in $(git branch -r | grep -v HEAD)
do
git branch -r -d $b || exit 1
done &&
@@ -819,7 +925,7 @@ test_expect_success 'update default (overridden, with funny whitespace)' '
test_expect_success 'update (with remotes.default defined)' '
(
cd one &&
- for b in $(git branch -r)
+ for b in $(git branch -r | grep -v HEAD)
do
git branch -r -d $b || exit 1
done &&
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 3b3991ab86..2d9587059f 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -74,6 +74,168 @@ test_expect_success "fetch test for-merge" '
cut -f -2 .git/FETCH_HEAD >actual &&
test_cmp expected actual'
+test_expect_success "fetch test remote HEAD" '
+ cd "$D" &&
+ cd two &&
+ git fetch &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/main) &&
+ test "z$head" = "z$branch"'
+
+test_expect_success "fetch test remote HEAD change" '
+ cd "$D" &&
+ cd two &&
+ git switch -c other &&
+ git push -u origin other &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ git rev-parse --verify refs/remotes/origin/other &&
+ git remote set-head origin other &&
+ git fetch &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/other) &&
+ test "z$head" = "z$branch"'
+
+test_expect_success "fetch test followRemoteHEAD never" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git update-ref --no-deref -d refs/remotes/origin/HEAD &&
+ git config set remote.origin.followRemoteHEAD "never" &&
+ git fetch &&
+ test_must_fail git rev-parse --verify refs/remotes/origin/HEAD
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD warn no change" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git rev-parse --verify refs/remotes/origin/other &&
+ git remote set-head origin other &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ git config set remote.origin.followRemoteHEAD "warn" &&
+ git fetch >output &&
+ echo "${SQ}HEAD${SQ} at ${SQ}origin${SQ} is ${SQ}main${SQ}," \
+ "but we have ${SQ}other${SQ} locally." >expect &&
+ test_cmp expect output &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/other) &&
+ test "z$head" = "z$branch"
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD warn create" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git update-ref --no-deref -d refs/remotes/origin/HEAD &&
+ git config set remote.origin.followRemoteHEAD "warn" &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ output=$(git fetch) &&
+ test "z" = "z$output" &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/main) &&
+ test "z$head" = "z$branch"
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD warn detached" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git update-ref --no-deref -d refs/remotes/origin/HEAD &&
+ git update-ref refs/remotes/origin/HEAD HEAD &&
+ HEAD=$(git log --pretty="%H") &&
+ git config set remote.origin.followRemoteHEAD "warn" &&
+ git fetch >output &&
+ echo "${SQ}HEAD${SQ} at ${SQ}origin${SQ} is ${SQ}main${SQ}," \
+ "but we have a detached HEAD pointing to" \
+ "${SQ}${HEAD}${SQ} locally." >expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD warn quiet" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git rev-parse --verify refs/remotes/origin/other &&
+ git remote set-head origin other &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ git config set remote.origin.followRemoteHEAD "warn" &&
+ output=$(git fetch --quiet) &&
+ test "z" = "z$output" &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/other) &&
+ test "z$head" = "z$branch"
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD warn-if-not-branch branch is same" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git rev-parse --verify refs/remotes/origin/other &&
+ git remote set-head origin other &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ git config set remote.origin.followRemoteHEAD "warn-if-not-main" &&
+ actual=$(git fetch) &&
+ test "z" = "z$actual" &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/other) &&
+ test "z$head" = "z$branch"
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD warn-if-not-branch branch is different" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git rev-parse --verify refs/remotes/origin/other &&
+ git remote set-head origin other &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ git config set remote.origin.followRemoteHEAD "warn-if-not-some/different-branch" &&
+ git fetch >actual &&
+ echo "${SQ}HEAD${SQ} at ${SQ}origin${SQ} is ${SQ}main${SQ}," \
+ "but we have ${SQ}other${SQ} locally." >expect &&
+ test_cmp expect actual &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/other) &&
+ test "z$head" = "z$branch"
+ )
+'
+
+test_expect_success "fetch test followRemoteHEAD always" '
+ test_when_finished "git config unset remote.origin.followRemoteHEAD" &&
+ (
+ cd "$D" &&
+ cd two &&
+ git rev-parse --verify refs/remotes/origin/other &&
+ git remote set-head origin other &&
+ git rev-parse --verify refs/remotes/origin/HEAD &&
+ git rev-parse --verify refs/remotes/origin/main &&
+ git config set remote.origin.followRemoteHEAD "always" &&
+ git fetch &&
+ head=$(git rev-parse refs/remotes/origin/HEAD) &&
+ branch=$(git rev-parse refs/remotes/origin/main) &&
+ test "z$head" = "z$branch"
+ )
+'
+
test_expect_success 'fetch --prune on its own works as expected' '
cd "$D" &&
git clone . prune &&
@@ -164,6 +326,23 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
git rev-parse sometag
'
+test_expect_success 'fetch --tags gets tags even without a configured remote' '
+ REMOTE="$(pwd)/test_tag_1" &&
+ git init test_tag_1 &&
+ (
+ cd test_tag_1 &&
+ test_commit foo
+ ) &&
+ git init test_tag_2 &&
+ (
+ cd test_tag_2 &&
+ git fetch --tags "file://$REMOTE" &&
+ echo "foo" >expect &&
+ git tag >actual &&
+ test_cmp expect actual
+ )
+'
+
test_expect_success REFFILES 'fetch --prune fails to delete branches' '
cd "$D" &&
git clone . prune-fail &&
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 3a67992a7d..5930f55186 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -292,6 +292,8 @@ test_expect_success 'ls-remote with filtered symref (refname)' '
cat >expect <<-EOF &&
ref: refs/heads/main HEAD
$rev HEAD
+ ref: refs/remotes/origin/main refs/remotes/origin/HEAD
+ $rev refs/remotes/origin/HEAD
EOF
git ls-remote --symref . HEAD >actual &&
test_cmp expect actual
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index 25772c85c5..523aff6268 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -44,14 +44,17 @@ test_expect_success setup '
'
cat > test/expect << EOF
+ one/HEAD -> one/main
one/main
one/side
origin/HEAD -> origin/main
origin/main
origin/side
+ three/HEAD -> three/main
three/another
three/main
three/side
+ two/HEAD -> two/main
two/another
two/main
two/side
@@ -96,6 +99,7 @@ cat > expect << EOF
origin/HEAD -> origin/main
origin/main
origin/side
+ three/HEAD -> three/main
three/another
three/main
three/side
@@ -111,8 +115,10 @@ test_expect_success 'git fetch --multiple (but only one remote)' '
'
cat > expect << EOF
+ one/HEAD -> one/main
one/main
one/side
+ two/HEAD -> two/main
two/another
two/main
two/side
@@ -140,7 +146,7 @@ test_expect_success 'git fetch --multiple (bad remote names)' '
test_expect_success 'git fetch --all (skipFetchAll)' '
(cd test4 &&
- for b in $(git branch -r)
+ for b in $(git branch -r | grep -v HEAD)
do
git branch -r -d $b || exit 1
done &&
@@ -152,11 +158,14 @@ test_expect_success 'git fetch --all (skipFetchAll)' '
'
cat > expect << EOF
+ one/HEAD -> one/main
one/main
one/side
+ three/HEAD -> three/main
three/another
three/main
three/side
+ two/HEAD -> two/main
two/another
two/main
two/side
@@ -164,7 +173,7 @@ EOF
test_expect_success 'git fetch --multiple (ignoring skipFetchAll)' '
(cd test4 &&
- for b in $(git branch -r)
+ for b in $(git branch -r | grep -v HEAD)
do
git branch -r -d $b || exit 1
done &&
@@ -220,14 +229,17 @@ test_expect_success 'git fetch --multiple --jobs=0 picks a default' '
create_fetch_all_expect () {
cat >expect <<-\EOF
+ one/HEAD -> one/main
one/main
one/side
origin/HEAD -> origin/main
origin/main
origin/side
+ three/HEAD -> three/main
three/another
three/main
three/side
+ two/HEAD -> two/main
two/another
two/main
two/side
@@ -264,6 +276,7 @@ test_expect_success 'git fetch (fetch all remotes with fetch.all = true)' '
create_fetch_one_expect () {
cat >expect <<-\EOF
+ one/HEAD -> one/main
one/main
one/side
origin/HEAD -> origin/main
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 9d693eb57f..041d7d806f 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1394,7 +1394,8 @@ test_expect_success 'fetch follows tags by default' '
git tag -m "annotated" tag &&
git for-each-ref >tmp1 &&
sed -n "p; s|refs/heads/main$|refs/remotes/origin/main|p" tmp1 |
- sort -k 3 >../expect
+ sed -n "p; s|refs/heads/main$|refs/remotes/origin/HEAD|p" |
+ sort -k 4 >../expect
) &&
test_when_finished "rm -rf dst" &&
git init dst &&
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index e2770e4541..0de8eb5b6f 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -51,7 +51,8 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
long
main
EOF
- git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
+ git for-each-ref --format="%(subject)" refs/remotes/long \
+ --exclude=refs/remotes/long/HEAD >actual &&
test_cmp expect actual
'
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 71428f3d5c..538b603f03 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -343,7 +343,7 @@ test_expect_success 'push over smart http with auth' '
git push "$HTTPD_URL"/auth/smart/test_repo.git &&
git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git" \
log -1 --format=%s >actual &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
test_cmp expect actual
'
@@ -355,7 +355,7 @@ test_expect_success 'push to auth-only-for-push repo' '
git push "$HTTPD_URL"/auth-push/smart/test_repo.git &&
git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git" \
log -1 --format=%s >actual &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
test_cmp expect actual
'
@@ -385,7 +385,7 @@ test_expect_success 'push into half-auth-complete requires password' '
git push "$HTTPD_URL/half-auth-complete/smart/half-auth.git" &&
git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/half-auth.git" \
log -1 --format=%s >actual &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
test_cmp expect actual
'
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 21795a19bf..ed0ad66fad 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -111,13 +111,13 @@ test_expect_success 'http auth can use user/pass in URL' '
test_expect_success 'http auth can use just user in URL' '
set_askpass wrong pass@host &&
git clone "$HTTPD_URL_USER/auth/dumb/repo.git" clone-auth-pass &&
- expect_askpass pass user@host
+ expect_askpass pass user%40host
'
test_expect_success 'http auth can request both user and pass' '
set_askpass user@host pass@host &&
git clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-both &&
- expect_askpass both user@host
+ expect_askpass both user%40host
'
test_expect_success 'http auth respects credential helper config' '
@@ -135,14 +135,14 @@ test_expect_success 'http auth can get username from config' '
test_config_global "credential.$HTTPD_URL.username" user@host &&
set_askpass wrong pass@host &&
git clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-user &&
- expect_askpass pass user@host
+ expect_askpass pass user%40host
'
test_expect_success 'configured username does not override URL' '
test_config_global "credential.$HTTPD_URL.username" wrong &&
set_askpass wrong pass@host &&
git clone "$HTTPD_URL_USER/auth/dumb/repo.git" clone-auth-user2 &&
- expect_askpass pass user@host
+ expect_askpass pass user%40host
'
test_expect_success 'set up repo with http submodules' '
@@ -163,7 +163,7 @@ test_expect_success 'cmdline credential config passes to submodule via clone' '
set_askpass wrong pass@host &&
git -c "credential.$HTTPD_URL.username=user@host" \
clone --recursive super super-clone &&
- expect_askpass pass user@host
+ expect_askpass pass user%40host
'
test_expect_success 'cmdline credential config passes submodule via fetch' '
@@ -174,7 +174,7 @@ test_expect_success 'cmdline credential config passes submodule via fetch' '
git -C super-clone \
-c "credential.$HTTPD_URL.username=user@host" \
fetch --recurse-submodules &&
- expect_askpass pass user@host
+ expect_askpass pass user%40host
'
test_expect_success 'cmdline credential config passes submodule update' '
@@ -191,7 +191,7 @@ test_expect_success 'cmdline credential config passes submodule update' '
git -C super-clone \
-c "credential.$HTTPD_URL.username=user@host" \
submodule update &&
- expect_askpass pass user@host
+ expect_askpass pass user%40host
'
test_expect_success 'fetch changes via http' '
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index ceb3336a5c..761fdfcfe6 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -181,7 +181,7 @@ test_expect_success 'clone from password-protected repository' '
echo two >expect &&
set_askpass user@host pass@host &&
git clone --bare "$HTTPD_URL/auth/smart/repo.git" smart-auth &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
git --git-dir=smart-auth log -1 --format=%s >actual &&
test_cmp expect actual
'
@@ -221,7 +221,7 @@ test_expect_success 'clone from auth-only-for-objects repository' '
echo two >expect &&
set_askpass user@host pass@host &&
git clone --bare "$HTTPD_URL/auth-fetch/smart/repo.git" half-auth &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
git --git-dir=half-auth log -1 --format=%s >actual &&
test_cmp expect actual
'
@@ -246,14 +246,14 @@ test_expect_success 'redirects send auth to new location' '
set_askpass user@host pass@host &&
git -c credential.useHttpPath=true \
clone $HTTPD_URL/smart-redir-auth/repo.git repo-redir-auth &&
- expect_askpass both user@host auth/smart/repo.git
+ expect_askpass both user%40host auth/smart/repo.git
'
test_expect_success 'GIT_TRACE_CURL redacts auth details' '
rm -rf redact-auth trace &&
set_askpass user@host pass@host &&
GIT_TRACE_CURL="$(pwd)/trace" git clone --bare "$HTTPD_URL/auth/smart/repo.git" redact-auth &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
# Ensure that there is no "Basic" followed by a base64 string, but that
# the auth details are redacted
@@ -265,7 +265,7 @@ test_expect_success 'GIT_CURL_VERBOSE redacts auth details' '
rm -rf redact-auth trace &&
set_askpass user@host pass@host &&
GIT_CURL_VERBOSE=1 git clone --bare "$HTTPD_URL/auth/smart/repo.git" redact-auth 2>trace &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
# Ensure that there is no "Basic" followed by a base64 string, but that
# the auth details are redacted
@@ -278,7 +278,7 @@ test_expect_success 'GIT_TRACE_CURL does not redact auth details if GIT_TRACE_RE
set_askpass user@host pass@host &&
GIT_TRACE_REDACT=0 GIT_TRACE_CURL="$(pwd)/trace" \
git clone --bare "$HTTPD_URL/auth/smart/repo.git" redact-auth &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
grep -i "Authorization: Basic [0-9a-zA-Z+/]" trace
'
@@ -592,7 +592,7 @@ test_expect_success 'http auth remembers successful credentials' '
# the first request prompts the user...
set_askpass user@host pass@host &&
git ls-remote "$HTTPD_URL/auth/smart/repo.git" >/dev/null &&
- expect_askpass both user@host &&
+ expect_askpass both user%40host &&
# ...and the second one uses the stored value rather than
# prompting the user.
@@ -623,7 +623,7 @@ test_expect_success 'http auth forgets bogus credentials' '
# us to prompt the user again.
set_askpass user@host pass@host &&
git ls-remote "$HTTPD_URL/auth/smart/repo.git" >/dev/null &&
- expect_askpass both user@host
+ expect_askpass both user%40host
'
test_expect_success 'client falls back from v2 to v0 to match server' '
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index fa5ca4f522..470bfb610c 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -130,7 +130,7 @@ test_expect_success 'cloning with multiple references drops duplicates' '
test_expect_success 'clone with reference from a tagged repository' '
(
- cd A && git tag -a -m tagged HEAD
+ cd A && git tag -a -m tagged foo
) &&
git clone --reference=A A I
'
@@ -155,10 +155,10 @@ test_expect_success 'fetch with incomplete alternates' '
git remote add J "file://$base_dir/J" &&
GIT_TRACE_PACKET=$U.K git fetch J
) &&
- main_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/main) &&
+ main_object=$(git -C A rev-parse --verify refs/heads/main) &&
test -s "$U.K" &&
! grep " want $main_object" "$U.K" &&
- tag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&
+ tag_object=$(git -C A rev-parse --verify refs/tags/foo) &&
! grep " want $tag_object" "$U.K"
'
diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh
index 339d8c786f..4605703496 100755
--- a/t/t5605-clone-local.sh
+++ b/t/t5605-clone-local.sh
@@ -153,6 +153,16 @@ test_expect_success 'cloning a local path with --no-local does not hardlink' '
! repo_is_hardlinked force-nonlocal
'
+test_expect_success 'cloning a local path with --no-local from a different user succeeds' '
+ git clone --upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
+ --no-local a nonlocal-otheruser 2>err &&
+ ! repo_is_hardlinked nonlocal-otheruser &&
+ # Verify that this is a git repository.
+ git -C nonlocal-otheruser rev-parse --show-toplevel &&
+ ! test_grep "detected dubious ownership" err
+
+'
+
test_expect_success 'cloning locally respects "-u" for fetching refs' '
test_must_fail git clone --bare -u false a should_not_work.git
'
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index 489c6570da..82e3621ec5 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -170,6 +170,13 @@ test_expect_success 'clone bundle with different fsckObjects configurations' '
test_must_fail git -c transfer.fsckObjects=true \
clone bundle-fsck/bad.bundle bundle-transfer-fsck 2>err &&
+ test_grep "missingEmail" err &&
+
+ git -c fetch.fsckObjects=true -c fetch.fsck.missingEmail=ignore \
+ clone bundle-fsck/bad.bundle bundle-fsck-ignore &&
+
+ test_must_fail git -c fetch.fsckObjects=true -c fetch.fsck.missingEmail=error \
+ clone bundle-fsck/bad.bundle bundle-fsck-error 2>err &&
test_grep "missingEmail" err
'
diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh
index 5d444bfe20..4ce62feaa2 100755
--- a/t/t6020-bundle-misc.sh
+++ b/t/t6020-bundle-misc.sh
@@ -504,6 +504,50 @@ test_expect_success 'unfiltered bundle with --objects' '
test_cmp expect actual
'
+test_expect_success 'full bundle upto annotated tag' '
+ git bundle create v2.bdl \
+ v2 &&
+
+ git bundle verify v2.bdl |
+ make_user_friendly_and_stable_output >actual &&
+
+ format_and_save_expect <<-EOF &&
+ The bundle contains this ref:
+ <TAG-2> refs/tags/v2
+ The bundle records a complete history.
+ $HASH_MESSAGE
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'clone from full bundle upto annotated tag' '
+ git clone --mirror v2.bdl tag-clone.git &&
+ git -C tag-clone.git show-ref |
+ make_user_friendly_and_stable_output >actual &&
+ cat >expect <<-\EOF &&
+ <TAG-2> refs/tags/v2
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'incremental bundle between two annotated tags' '
+ git bundle create v1-v2.bdl \
+ v1..v2 &&
+
+ git bundle verify v1-v2.bdl |
+ make_user_friendly_and_stable_output >actual &&
+
+ format_and_save_expect <<-EOF &&
+ The bundle contains this ref:
+ <TAG-2> refs/tags/v2
+ The bundle requires these 2 refs:
+ <COMMIT-E> Z
+ <COMMIT-B> Z
+ $HASH_MESSAGE
+ EOF
+ test_cmp expect actual
+'
+
for filter in "blob:none" "tree:0" "tree:1" "blob:limit=100"
do
test_expect_success "filtered bundle: $filter" '
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 79e0f19deb..76843a6169 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -18,6 +18,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
check_describe () {
indir= &&
+ outcome=success &&
while test $# != 0
do
case "$1" in
@@ -25,6 +26,9 @@ check_describe () {
indir="$2"
shift
;;
+ --expect-failure)
+ outcome=failure
+ ;;
*)
break
;;
@@ -35,7 +39,7 @@ check_describe () {
expect="$1"
shift
describe_opts="$@"
- test_expect_success "describe $describe_opts" '
+ test_expect_${outcome} "describe $describe_opts" '
git ${indir:+ -C "$indir"} describe $describe_opts >raw &&
sed -e "s/-g[0-9a-f]*\$/-gHASH/" <raw >actual &&
echo "$expect" >expect &&
@@ -78,11 +82,13 @@ check_describe R-2-gHASH HEAD^^
check_describe A-3-gHASH HEAD^^2
check_describe B HEAD^^2^
check_describe R-1-gHASH HEAD^^^
+check_describe R-1-gHASH R-1-g$(git rev-parse --short HEAD^^)~1
check_describe c-7-gHASH --tags HEAD
check_describe c-6-gHASH --tags HEAD^
check_describe e-1-gHASH --tags HEAD^^
check_describe c-2-gHASH --tags HEAD^^2
+check_describe c-2-gHASH --tags c-2-g$(git rev-parse --short HEAD^^2)^0
check_describe B --tags HEAD^^2^
check_describe e --tags HEAD^^^
check_describe e --tags --exact-match HEAD^^^
@@ -616,7 +622,7 @@ test_expect_success 'name-rev --annotate-stdin works with commitGraph' '
# B
# o
-# \
+# H \
# o-----o---o----x
# A
#
@@ -626,6 +632,7 @@ test_expect_success 'setup: describe commits with disjoint bases' '
cd disjoint1 &&
echo o >> file && git add file && git commit -m o &&
+ git tag H -a -m H &&
echo A >> file && git add file && git commit -m A &&
git tag A -a -m A &&
echo o >> file && git add file && git commit -m o &&
@@ -638,8 +645,9 @@ test_expect_success 'setup: describe commits with disjoint bases' '
'
check_describe -C disjoint1 "A-3-gHASH" HEAD
+check_describe -C disjoint1 --expect-failure "A-3-gHASH" --candidates=2 HEAD
-# B
+# H B
# o---o---o------------.
# \
# o---o---x
@@ -657,6 +665,7 @@ test_expect_success 'setup: describe commits with disjoint bases 2' '
git checkout --orphan branch &&
echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:00" git commit -m o &&
echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:01" git commit -m o &&
+ git tag H -a -m H &&
echo B >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:02" git commit -m B &&
git tag B -a -m B &&
git merge --no-ff --allow-unrelated-histories main -m x
@@ -664,6 +673,7 @@ test_expect_success 'setup: describe commits with disjoint bases 2' '
'
check_describe -C disjoint2 "B-3-gHASH" HEAD
+check_describe -C disjoint2 --expect-failure "B-3-gHASH" --candidates=2 HEAD
test_expect_success 'setup misleading taggerdates' '
GIT_COMMITTER_DATE="2006-12-12 12:31" git tag -a -m "another tag" newer-tag-older-commit unique-file~1
@@ -707,4 +717,36 @@ test_expect_success 'describe --broken --dirty with a file with changed stat' '
)
'
+test_expect_success '--always with no refs falls back to commit hash' '
+ git rev-parse HEAD >expect &&
+ git describe --no-abbrev --always --match=no-such-tag >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--exact-match does not show --always fallback' '
+ test_must_fail git describe --exact-match --always
+'
+
+test_expect_success 'avoid being fooled by describe-like filename' '
+ test_when_finished rm out &&
+
+ git rev-parse --short HEAD >out &&
+ FILENAME=filename-g$(cat out) &&
+ touch $FILENAME &&
+ git add $FILENAME &&
+ git commit -m "Add $FILENAME" &&
+
+ git cat-file -t HEAD:$FILENAME >actual &&
+
+ echo blob >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'do not be fooled by invalid describe format ' '
+ test_when_finished rm out &&
+
+ git rev-parse --short HEAD >out &&
+ test_must_fail git cat-file -t "refs/tags/super-invalid/./../...../ ~^:/?*[////\\\\\\&}/busted.lock-42-g"$(cat out)
+'
+
test_done
diff --git a/t/t6600-test-reach.sh b/t/t6600-test-reach.sh
index 2591f8b8b3..6638d1aa1d 100755
--- a/t/t6600-test-reach.sh
+++ b/t/t6600-test-reach.sh
@@ -733,4 +733,33 @@ test_expect_success 'for-each-ref is-base:multiple' '
--format="%(refname)[%(is-base:commit-2-3)-%(is-base:commit-6-5)]" --stdin
'
+test_expect_success 'for-each-ref is-base: --sort' '
+ cat >input <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-4-2
+ refs/heads/commit-4-4
+ refs/heads/commit-8-4
+ EOF
+
+ cat >expect <<-\EOF &&
+ refs/heads/commit-1-1
+ refs/heads/commit-4-4
+ refs/heads/commit-8-4
+ refs/heads/commit-4-2
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname)" --stdin \
+ --sort=refname --sort=is-base:commit-2-3 &&
+
+ cat >expect <<-\EOF &&
+ refs/heads/commit-4-2
+ refs/heads/commit-1-1
+ refs/heads/commit-4-4
+ refs/heads/commit-8-4
+ EOF
+ run_all_modes git for-each-ref \
+ --format="%(refname)" --stdin \
+ --sort=refname --sort=-is-base:commit-2-3
+'
+
test_done
diff --git a/t/t6601-path-walk.sh b/t/t6601-path-walk.sh
new file mode 100755
index 0000000000..5f04acb8a2
--- /dev/null
+++ b/t/t6601-path-walk.sh
@@ -0,0 +1,368 @@
+#!/bin/sh
+
+TEST_PASSES_SANITIZE_LEAK=true
+
+test_description='direct path-walk API tests'
+
+. ./test-lib.sh
+
+test_expect_success 'setup test repository' '
+ git checkout -b base &&
+
+ # Make some objects that will only be reachable
+ # via non-commit tags.
+ mkdir child &&
+ echo file >child/file &&
+ git add child &&
+ git commit -m "will abandon" &&
+ git tag -a -m "tree" tree-tag HEAD^{tree} &&
+ echo file2 >file2 &&
+ git add file2 &&
+ git commit --amend -m "will abandon" &&
+ git tag tree-tag2 HEAD^{tree} &&
+
+ echo blob >file &&
+ blob_oid=$(git hash-object -t blob -w --stdin <file) &&
+ git tag -a -m "blob" blob-tag "$blob_oid" &&
+ echo blob2 >file2 &&
+ blob2_oid=$(git hash-object -t blob -w --stdin <file2) &&
+ git tag blob-tag2 "$blob2_oid" &&
+
+ rm -fr child file file2 &&
+
+ mkdir left &&
+ mkdir right &&
+ echo a >a &&
+ echo b >left/b &&
+ echo c >right/c &&
+ git add . &&
+ git commit --amend -m "first" &&
+ git tag -m "first" first HEAD &&
+
+ echo d >right/d &&
+ git add right &&
+ git commit -m "second" &&
+ git tag -a -m "second (under)" second.1 HEAD &&
+ git tag -a -m "second (top)" second.2 second.1 &&
+
+ # Set up file/dir collision in history.
+ rm a &&
+ mkdir a &&
+ echo a >a/a &&
+ echo bb >left/b &&
+ git add a left &&
+ git commit -m "third" &&
+ git tag -a -m "third" third &&
+
+ git checkout -b topic HEAD~1 &&
+ echo cc >right/c &&
+ git commit -a -m "topic" &&
+ git tag -a -m "fourth" fourth
+'
+
+test_expect_success 'all' '
+ test-tool path-walk -- --all >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 0:commit::$(git rev-parse base)
+ 0:commit::$(git rev-parse base~1)
+ 0:commit::$(git rev-parse base~2)
+ 1:tag:/tags:$(git rev-parse refs/tags/first)
+ 1:tag:/tags:$(git rev-parse refs/tags/second.1)
+ 1:tag:/tags:$(git rev-parse refs/tags/second.2)
+ 1:tag:/tags:$(git rev-parse refs/tags/third)
+ 1:tag:/tags:$(git rev-parse refs/tags/fourth)
+ 1:tag:/tags:$(git rev-parse refs/tags/tree-tag)
+ 1:tag:/tags:$(git rev-parse refs/tags/blob-tag)
+ 2:blob:/tagged-blobs:$(git rev-parse refs/tags/blob-tag^{})
+ 2:blob:/tagged-blobs:$(git rev-parse refs/tags/blob-tag2^{})
+ 3:tree::$(git rev-parse topic^{tree})
+ 3:tree::$(git rev-parse base^{tree})
+ 3:tree::$(git rev-parse base~1^{tree})
+ 3:tree::$(git rev-parse base~2^{tree})
+ 3:tree::$(git rev-parse refs/tags/tree-tag^{})
+ 3:tree::$(git rev-parse refs/tags/tree-tag2^{})
+ 4:blob:a:$(git rev-parse base~2:a)
+ 5:blob:file2:$(git rev-parse refs/tags/tree-tag2^{}:file2)
+ 6:tree:a/:$(git rev-parse base:a)
+ 7:tree:child/:$(git rev-parse refs/tags/tree-tag:child)
+ 8:blob:child/file:$(git rev-parse refs/tags/tree-tag:child/file)
+ 9:tree:left/:$(git rev-parse base:left)
+ 9:tree:left/:$(git rev-parse base~2:left)
+ 10:blob:left/b:$(git rev-parse base~2:left/b)
+ 10:blob:left/b:$(git rev-parse base:left/b)
+ 11:tree:right/:$(git rev-parse topic:right)
+ 11:tree:right/:$(git rev-parse base~1:right)
+ 11:tree:right/:$(git rev-parse base~2:right)
+ 12:blob:right/c:$(git rev-parse base~2:right/c)
+ 12:blob:right/c:$(git rev-parse topic:right/c)
+ 13:blob:right/d:$(git rev-parse base~1:right/d)
+ blobs:10
+ commits:4
+ tags:7
+ trees:13
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'indexed objects' '
+ test_when_finished git reset --hard &&
+
+ # stage change into index, adding a blob but
+ # also invalidating the cache-tree for the root
+ # and the "left" directory.
+ echo bogus >left/c &&
+ git add left &&
+
+ test-tool path-walk -- --indexed-objects >out &&
+
+ cat >expect <<-EOF &&
+ 0:blob:a:$(git rev-parse HEAD:a)
+ 1:blob:left/b:$(git rev-parse HEAD:left/b)
+ 2:blob:left/c:$(git rev-parse :left/c)
+ 3:blob:right/c:$(git rev-parse HEAD:right/c)
+ 4:blob:right/d:$(git rev-parse HEAD:right/d)
+ 5:tree:right/:$(git rev-parse topic:right)
+ blobs:5
+ commits:0
+ tags:0
+ trees:1
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'branches and indexed objects mix well' '
+ test_when_finished git reset --hard &&
+
+ # stage change into index, adding a blob but
+ # also invalidating the cache-tree for the root
+ # and the "right" directory.
+ echo fake >right/d &&
+ git add right &&
+
+ test-tool path-walk -- --indexed-objects --branches >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 0:commit::$(git rev-parse base)
+ 0:commit::$(git rev-parse base~1)
+ 0:commit::$(git rev-parse base~2)
+ 1:tree::$(git rev-parse topic^{tree})
+ 1:tree::$(git rev-parse base^{tree})
+ 1:tree::$(git rev-parse base~1^{tree})
+ 1:tree::$(git rev-parse base~2^{tree})
+ 2:tree:a/:$(git rev-parse refs/tags/third:a)
+ 3:tree:left/:$(git rev-parse base:left)
+ 3:tree:left/:$(git rev-parse base~2:left)
+ 4:blob:left/b:$(git rev-parse base:left/b)
+ 4:blob:left/b:$(git rev-parse base~2:left/b)
+ 5:tree:right/:$(git rev-parse topic:right)
+ 5:tree:right/:$(git rev-parse base~1:right)
+ 5:tree:right/:$(git rev-parse base~2:right)
+ 6:blob:right/c:$(git rev-parse base~2:right/c)
+ 6:blob:right/c:$(git rev-parse topic:right/c)
+ 7:blob:right/d:$(git rev-parse base~1:right/d)
+ 7:blob:right/d:$(git rev-parse :right/d)
+ 8:blob:a:$(git rev-parse base~2:a)
+ blobs:7
+ commits:4
+ tags:0
+ trees:10
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'topic only' '
+ test-tool path-walk -- topic >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 0:commit::$(git rev-parse base~1)
+ 0:commit::$(git rev-parse base~2)
+ 1:tree::$(git rev-parse topic^{tree})
+ 1:tree::$(git rev-parse base~1^{tree})
+ 1:tree::$(git rev-parse base~2^{tree})
+ 2:blob:a:$(git rev-parse base~2:a)
+ 3:tree:left/:$(git rev-parse base~2:left)
+ 4:blob:left/b:$(git rev-parse base~2:left/b)
+ 5:tree:right/:$(git rev-parse topic:right)
+ 5:tree:right/:$(git rev-parse base~1:right)
+ 5:tree:right/:$(git rev-parse base~2:right)
+ 6:blob:right/c:$(git rev-parse base~2:right/c)
+ 6:blob:right/c:$(git rev-parse topic:right/c)
+ 7:blob:right/d:$(git rev-parse base~1:right/d)
+ blobs:5
+ commits:3
+ tags:0
+ trees:7
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'topic, not base' '
+ test-tool path-walk -- topic --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 1:tree::$(git rev-parse topic^{tree})
+ 2:blob:a:$(git rev-parse topic:a):UNINTERESTING
+ 3:tree:left/:$(git rev-parse topic:left):UNINTERESTING
+ 4:blob:left/b:$(git rev-parse topic:left/b):UNINTERESTING
+ 5:tree:right/:$(git rev-parse topic:right)
+ 6:blob:right/c:$(git rev-parse topic:right/c)
+ 7:blob:right/d:$(git rev-parse topic:right/d):UNINTERESTING
+ blobs:4
+ commits:1
+ tags:0
+ trees:3
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'fourth, blob-tag2, not base' '
+ test-tool path-walk -- fourth blob-tag2 --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 1:tag:/tags:$(git rev-parse fourth)
+ 2:blob:/tagged-blobs:$(git rev-parse refs/tags/blob-tag2^{})
+ 3:tree::$(git rev-parse topic^{tree})
+ 4:blob:a:$(git rev-parse base~1:a):UNINTERESTING
+ 5:tree:left/:$(git rev-parse base~1:left):UNINTERESTING
+ 6:blob:left/b:$(git rev-parse base~1:left/b):UNINTERESTING
+ 7:tree:right/:$(git rev-parse topic:right)
+ 8:blob:right/c:$(git rev-parse topic:right/c)
+ 9:blob:right/d:$(git rev-parse base~1:right/d):UNINTERESTING
+ blobs:5
+ commits:1
+ tags:1
+ trees:3
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'topic, not base, only blobs' '
+ test-tool path-walk --no-trees --no-commits \
+ -- topic --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:blob:a:$(git rev-parse topic:a):UNINTERESTING
+ 1:blob:left/b:$(git rev-parse topic:left/b):UNINTERESTING
+ 2:blob:right/c:$(git rev-parse topic:right/c)
+ 3:blob:right/d:$(git rev-parse topic:right/d):UNINTERESTING
+ blobs:4
+ commits:0
+ tags:0
+ trees:0
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+# No, this doesn't make a lot of sense for the path-walk API,
+# but it is possible to do.
+test_expect_success 'topic, not base, only commits' '
+ test-tool path-walk --no-blobs --no-trees \
+ -- topic --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ commits:1
+ blobs:0
+ tags:0
+ trees:0
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'topic, not base, only trees' '
+ test-tool path-walk --no-blobs --no-commits \
+ -- topic --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:tree::$(git rev-parse topic^{tree})
+ 1:tree:left/:$(git rev-parse topic:left):UNINTERESTING
+ 2:tree:right/:$(git rev-parse topic:right)
+ commits:0
+ blobs:0
+ tags:0
+ trees:3
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'topic, not base, boundary' '
+ test-tool path-walk -- --boundary topic --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 0:commit::$(git rev-parse base~1):UNINTERESTING
+ 1:tree::$(git rev-parse topic^{tree})
+ 1:tree::$(git rev-parse base~1^{tree}):UNINTERESTING
+ 2:blob:a:$(git rev-parse base~1:a):UNINTERESTING
+ 3:tree:left/:$(git rev-parse base~1:left):UNINTERESTING
+ 4:blob:left/b:$(git rev-parse base~1:left/b):UNINTERESTING
+ 5:tree:right/:$(git rev-parse topic:right)
+ 5:tree:right/:$(git rev-parse base~1:right):UNINTERESTING
+ 6:blob:right/c:$(git rev-parse base~1:right/c):UNINTERESTING
+ 6:blob:right/c:$(git rev-parse topic:right/c)
+ 7:blob:right/d:$(git rev-parse base~1:right/d):UNINTERESTING
+ blobs:5
+ commits:2
+ tags:0
+ trees:5
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'topic, not base, boundary with pruning' '
+ test-tool path-walk --prune -- --boundary topic --not base >out &&
+
+ cat >expect <<-EOF &&
+ 0:commit::$(git rev-parse topic)
+ 0:commit::$(git rev-parse base~1):UNINTERESTING
+ 1:tree::$(git rev-parse topic^{tree})
+ 1:tree::$(git rev-parse base~1^{tree}):UNINTERESTING
+ 2:tree:right/:$(git rev-parse topic:right)
+ 2:tree:right/:$(git rev-parse base~1:right):UNINTERESTING
+ 3:blob:right/c:$(git rev-parse base~1:right/c):UNINTERESTING
+ 3:blob:right/c:$(git rev-parse topic:right/c)
+ blobs:2
+ commits:2
+ tags:0
+ trees:4
+ EOF
+
+ test_cmp_sorted expect out
+'
+
+test_expect_success 'trees are reported exactly once' '
+ test_when_finished "rm -rf unique-trees" &&
+ test_create_repo unique-trees &&
+ (
+ cd unique-trees &&
+ mkdir initial &&
+ test_commit initial/file &&
+ git switch -c move-to-top &&
+ git mv initial/file.t ./ &&
+ test_tick &&
+ git commit -m moved &&
+ git update-ref refs/heads/other HEAD
+ ) &&
+ test-tool -C unique-trees path-walk -- --all >out &&
+ tree=$(git -C unique-trees rev-parse HEAD:) &&
+ grep "$tree" out >out-filtered &&
+ test_line_count = 1 out-filtered
+'
+
+test_done
diff --git a/t/t7002-mv-sparse-checkout.sh b/t/t7002-mv-sparse-checkout.sh
index 26582ae4e5..4d3f221224 100755
--- a/t/t7002-mv-sparse-checkout.sh
+++ b/t/t7002-mv-sparse-checkout.sh
@@ -32,7 +32,7 @@ test_expect_success 'setup' "
hint: If you intend to update such entries, try one of the following:
hint: * Use the --sparse option.
hint: * Disable or modify the sparsity rules.
- hint: Disable this message with \"git config advice.updateSparsePath false\"
+ hint: Disable this message with \"git config set advice.updateSparsePath false\"
EOF
cat >dirty_error_header <<-EOF &&
@@ -45,7 +45,7 @@ test_expect_success 'setup' "
hint: To correct the sparsity of these paths, do the following:
hint: * Use \"git add --sparse <paths>\" to update the index
hint: * Use \"git sparse-checkout reapply\" to apply the sparsity rules
- hint: Disable this message with \"git config advice.updateSparsePath false\"
+ hint: Disable this message with \"git config set advice.updateSparsePath false\"
EOF
"
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index b1316e62f4..10835631ca 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -91,6 +91,18 @@ test_expect_success 'creating a tag using default HEAD should succeed' '
test_must_fail git reflog exists refs/tags/mytag
'
+test_expect_success 'HEAD is forbidden as a tagname' '
+ test_when_finished "git update-ref --no-deref -d refs/tags/HEAD || :" &&
+ test_must_fail git tag HEAD &&
+ test_must_fail git tag -a -m "useless" HEAD
+'
+
+test_expect_success '"git tag" can remove a tag named HEAD' '
+ test_when_finished "git update-ref --no-deref -d refs/tags/HEAD || :" &&
+ git update-ref refs/tags/HEAD HEAD &&
+ git tag -d HEAD
+'
+
test_expect_success 'creating a tag with --create-reflog should create reflog' '
git log -1 \
--format="format:tag: tagging %h (%s, %cd)%n" \
@@ -1850,7 +1862,7 @@ test_expect_success 'recursive tagging should give advice' '
hint: already a tag. If you meant to tag the object that it points to, use:
hint:
hint: git tag -f nested annotated-v4.0^{}
- hint: Disable this message with "git config advice.nestedTag false"
+ hint: Disable this message with "git config set advice.nestedTag false"
EOF
git tag -m nested nested annotated-v4.0 2>actual &&
test_cmp expect actual
diff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh
index 61669a2d21..9a335071af 100755
--- a/t/t7110-reset-merge.sh
+++ b/t/t7110-reset-merge.sh
@@ -270,13 +270,13 @@ 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 &&
+ test_path_is_missing file2 &&
+ test_path_is_file file3 &&
git diff --exit-code file3 &&
git diff --exit-code branch3 file3 &&
git reset --merge HEAD &&
- ! test -f file3 &&
- ! test -f file2 &&
+ test_path_is_missing file3 &&
+ test_path_is_missing file2 &&
git diff --exit-code --cached
'
@@ -284,8 +284,8 @@ 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 &&
+ test_path_is_missing file2 &&
+ test_path_is_file file3 &&
git diff --exit-code file3 &&
git diff --exit-code branch3 file3 &&
test_must_fail git reset --keep HEAD 2>err.log &&
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 793da6e64e..9bcf7c0b40 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -224,7 +224,7 @@ test_expect_success 'switch to another branch while carrying a deletion' '
'
test_expect_success 'checkout to detach HEAD (with advice declined)' '
- git config advice.detachedHead false &&
+ git config set advice.detachedHead false &&
rev=$(git rev-parse --short renamer^) &&
git checkout -f renamer &&
git clean -f &&
@@ -244,7 +244,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
'
test_expect_success 'checkout to detach HEAD' '
- git config advice.detachedHead true &&
+ git config set advice.detachedHead true &&
rev=$(git rev-parse --short renamer^) &&
git checkout -f renamer &&
git clean -f &&
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 981488885f..d6a501d453 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -212,7 +212,7 @@ test_expect_success 'submodule add to .gitignored path fails' '
The following paths are ignored by one of your .gitignore files:
submod
hint: Use -f if you really want to add them.
- hint: Disable this message with "git config advice.addIgnoredFile false"
+ hint: Disable this message with "git config set advice.addIgnoredFile false"
EOF
# Does not use test_commit due to the ignore
echo "*" > .gitignore &&
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 8d7b234beb..77b6d0040e 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -426,14 +426,14 @@ test_expect_success 'option-like arguments passed to foreach commands are not lo
git submodule foreach "echo be --quiet" > ../expected &&
git submodule foreach echo be --quiet > ../actual
) &&
- grep -sq -e "--quiet" expected &&
+ test_grep -e "--quiet" expected &&
test_cmp expected actual
'
test_expect_success 'option-like arguments passed to foreach recurse correctly' '
git -C clone2 submodule foreach --recursive "echo be --an-option" >expect &&
git -C clone2 submodule foreach --recursive echo be --an-option >actual &&
- grep -e "--an-option" expect &&
+ test_grep -e "--an-option" expect &&
test_cmp expect actual
'
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index f9a5c98f3f..b2070d4e39 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1699,7 +1699,7 @@ test_expect_success 'setup slow status advice' '
EOF
git add .gitignore &&
git commit -m "Add .gitignore" &&
- git config advice.statusuoption true
+ git config set advice.statusuoption true
)
'
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index ef54cff4fa..2a8df29219 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -173,7 +173,7 @@ test_expect_success 'merge -h with invalid index' '
cd broken &&
git init &&
>.git/index &&
- test_expect_code 129 git merge -h 2>usage
+ test_expect_code 129 git merge -h >usage
) &&
test_grep "[Uu]sage: git merge" broken/usage
'
diff --git a/t/t7609-mergetool--lib.sh b/t/t7609-mergetool--lib.sh
index 330d6d603d..e8e205707e 100755
--- a/t/t7609-mergetool--lib.sh
+++ b/t/t7609-mergetool--lib.sh
@@ -7,7 +7,7 @@ Testing basic merge tools options'
. ./test-lib.sh
test_expect_success 'mergetool --tool=vimdiff creates the expected layout' '
- . "$GIT_BUILD_DIR"/mergetools/vimdiff &&
+ . "$GIT_TEST_MERGE_TOOLS_DIR"/vimdiff &&
run_unit_tests
'
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 22b3a85b3e..c077aba7ce 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -898,4 +898,12 @@ test_expect_success 'mergetool with guiDefault' '
git commit -m "branch1 resolved with mergetool"
'
+test_expect_success 'mergetool with non-existent tool' '
+ test_when_finished "git reset --hard" &&
+ git checkout -b test$test_count branch1 &&
+ test_must_fail git merge main &&
+ yes "" | test_must_fail git mergetool --tool=absent >out 2>&1 &&
+ test_grep "mergetool.absent.cmd not set for tool" out
+'
+
test_done
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index d6975ca48d..1a251485e1 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -54,13 +54,13 @@ test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
'
test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)"
'
test_expect_success 'fails without MERGE_HEAD (completed merge)' '
git merge clean_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
# Merge successfully completed
post_merge_head="$(git rev-parse HEAD)" &&
test_must_fail git merge --abort 2>output &&
@@ -68,7 +68,7 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '
'
test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$post_merge_head" = "$(git rev-parse HEAD)"
'
@@ -79,10 +79,10 @@ test_expect_success 'Forget previous merge' '
test_expect_success 'Abort after --no-commit' '
# Redo merge, but stop before creating merge commit
git merge --no-commit clean_branch &&
- test -f .git/MERGE_HEAD &&
+ test_path_is_file .git/MERGE_HEAD &&
# Abort non-conflicting merge
git merge --abort &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff)" &&
test -z "$(git diff --staged)"
@@ -91,10 +91,10 @@ test_expect_success 'Abort after --no-commit' '
test_expect_success 'Abort after conflicts' '
# Create conflicting merge
test_must_fail git merge conflict_branch &&
- test -f .git/MERGE_HEAD &&
+ test_path_is_file .git/MERGE_HEAD &&
# Abort conflicting merge
git merge --abort &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff)" &&
test -z "$(git diff --staged)"
@@ -105,7 +105,7 @@ test_expect_success 'Clean merge with dirty index fails' '
git add foo &&
git diff --staged > expect &&
test_must_fail git merge clean_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff)" &&
git diff --staged > actual &&
@@ -114,7 +114,7 @@ test_expect_success 'Clean merge with dirty index fails' '
test_expect_success 'Conflicting merge with dirty index fails' '
test_must_fail git merge conflict_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff)" &&
git diff --staged > actual &&
@@ -129,10 +129,10 @@ test_expect_success 'Reset index (but preserve worktree changes)' '
test_expect_success 'Abort clean merge with non-conflicting dirty worktree' '
git merge --no-commit clean_branch &&
- test -f .git/MERGE_HEAD &&
+ test_path_is_file .git/MERGE_HEAD &&
# Abort merge
git merge --abort &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff --staged)" &&
git diff > actual &&
@@ -141,10 +141,10 @@ test_expect_success 'Abort clean merge with non-conflicting dirty worktree' '
test_expect_success 'Abort conflicting merge with non-conflicting dirty worktree' '
test_must_fail git merge conflict_branch &&
- test -f .git/MERGE_HEAD &&
+ test_path_is_file .git/MERGE_HEAD &&
# Abort merge
git merge --abort &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff --staged)" &&
git diff > actual &&
@@ -159,7 +159,7 @@ test_expect_success 'Fail clean merge with conflicting dirty worktree' '
echo xyzzy >> bar &&
git diff > expect &&
test_must_fail git merge --no-commit clean_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff --staged)" &&
git diff > actual &&
@@ -168,7 +168,7 @@ test_expect_success 'Fail clean merge with conflicting dirty worktree' '
test_expect_success 'Fail conflicting merge with conflicting dirty worktree' '
test_must_fail git merge conflict_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff --staged)" &&
git diff > actual &&
@@ -183,7 +183,7 @@ test_expect_success 'Fail clean merge with matching dirty worktree' '
echo bart > bar &&
git diff > expect &&
test_must_fail git merge --no-commit clean_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff --staged)" &&
git diff > actual &&
@@ -194,7 +194,7 @@ test_expect_success 'Fail conflicting merge with matching dirty worktree' '
echo barf > bar &&
git diff > expect &&
test_must_fail git merge conflict_branch &&
- test ! -f .git/MERGE_HEAD &&
+ test_path_is_missing .git/MERGE_HEAD &&
test "$pre_merge_head" = "$(git rev-parse HEAD)" &&
test -z "$(git diff --staged)" &&
git diff > actual &&
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 0ce4ba1cbe..1909aed95e 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -328,7 +328,8 @@ test_expect_success 'incremental-repack task' '
# Delete refs that have not been repacked in these packs.
git for-each-ref --format="delete %(refname)" \
- refs/prefetch refs/tags refs/remotes >refs &&
+ refs/prefetch refs/tags refs/remotes \
+ --exclude=refs/remotes/*/HEAD >refs &&
git update-ref --stdin <refs &&
# Replace the object directory with this pack layout.
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index 0147de304b..e98993276a 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -126,6 +126,32 @@ test_expect_success '--no-abbrev works like --abbrev with full length' '
check_abbrev $hexsz --no-abbrev
'
+test_expect_success 'blame --abbrev gets truncated' '
+ check_abbrev $hexsz --abbrev=9000 HEAD
+'
+
+test_expect_success 'blame --abbrev gets truncated with boundary commit' '
+ check_abbrev $hexsz --abbrev=9000 ^HEAD
+'
+
+test_expect_success 'blame --abbrev -b truncates the blank boundary' '
+ # Note that `--abbrev=` always gets incremented by 1, which is why we
+ # expect 11 leading spaces and not 10.
+ cat >expect <<-EOF &&
+ $(printf "%11s" "") (<author@example.com> 2005-04-07 15:45:13 -0700 1) abbrev
+ EOF
+ git blame -b --abbrev=10 ^HEAD -- abbrev.t >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'blame with excessive --abbrev and -b culls to hash length' '
+ cat >expect <<-EOF &&
+ $(printf "%${hexsz}s" "") (<author@example.com> 2005-04-07 15:45:13 -0700 1) abbrev
+ EOF
+ git blame -b --abbrev=9000 ^HEAD -- abbrev.t >actual &&
+ test_cmp expect actual
+'
+
test_expect_success '--exclude-promisor-objects does not BUG-crash' '
test_must_fail git blame --exclude-promisor-objects one
'
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
index 027235d61a..a81662713e 100755
--- a/t/t9210-scalar.sh
+++ b/t/t9210-scalar.sh
@@ -150,7 +150,8 @@ test_expect_success 'scalar clone' '
"$(pwd)" &&
git for-each-ref --format="%(refname)" refs/remotes/origin/ >actual &&
- echo "refs/remotes/origin/parallel" >expect &&
+ echo "refs/remotes/origin/HEAD" >>expect &&
+ echo "refs/remotes/origin/parallel" >>expect &&
test_cmp expect actual &&
test_path_is_missing 1/2 &&
@@ -219,7 +220,7 @@ test_expect_success 'scalar reconfigure --all with includeIf.onbranch' '
done
'
- test_expect_success 'scalar reconfigure --all with detached HEADs' '
+test_expect_success 'scalar reconfigure --all with detached HEADs' '
repos="two three four" &&
for num in $repos
do
diff --git a/t/t9211-scalar-clone.sh b/t/t9211-scalar-clone.sh
index 7869f45ee6..01f71910f5 100755
--- a/t/t9211-scalar-clone.sh
+++ b/t/t9211-scalar-clone.sh
@@ -31,7 +31,7 @@ test_expect_success 'set up repository to clone' '
)
'
-cleanup_clone () {
+cleanup_clone() {
rm -rf "$1"
}
@@ -127,7 +127,7 @@ test_expect_success '--single-branch clones HEAD only' '
(
cd $enlistment/src &&
git for-each-ref refs/remotes/origin >out &&
- test_line_count = 1 out &&
+ test_line_count = 2 out &&
grep "refs/remotes/origin/base" out
) &&
@@ -141,7 +141,7 @@ test_expect_success '--no-single-branch clones all branches' '
(
cd $enlistment/src &&
git for-each-ref refs/remotes/origin >out &&
- test_line_count = 2 out &&
+ test_line_count = 3 out &&
grep "refs/remotes/origin/base" out &&
grep "refs/remotes/origin/parallel" out
) &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 27b2025f40..b258dbf1df 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -521,6 +521,113 @@ test_expect_success 'B: fail on invalid committer (5)' '
test_must_fail git fast-import <input
'
+test_expect_success 'B: fail on invalid file path of ..' '
+ cat >input <<-INPUT_END &&
+ blob
+ mark :1
+ data <<EOF
+ File contents
+ EOF
+
+ commit refs/heads/badpath
+ committer Name <email> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ Commit Message
+ COMMIT
+ M 100644 :1 ../invalid-path
+ INPUT_END
+
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
+ test_must_fail git fast-import <input
+'
+
+test_expect_success 'B: fail on invalid file path of .' '
+ cat >input <<-INPUT_END &&
+ blob
+ mark :1
+ data <<EOF
+ File contents
+ EOF
+
+ commit refs/heads/badpath
+ committer Name <email> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ Good path
+ COMMIT
+ M 100644 :1 ok-path
+
+ commit refs/heads/badpath
+ committer Name <email> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ Bad path
+ COMMIT
+ R ok-path ./invalid-path
+ INPUT_END
+
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
+ test_must_fail git fast-import <input
+'
+
+test_expect_success WINDOWS 'B: fail on invalid file path of C:' '
+ cat >input <<-INPUT_END &&
+ blob
+ mark :1
+ data <<EOF
+ File contents
+ EOF
+
+ commit refs/heads/badpath
+ committer Name <email> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ Commit Message
+ COMMIT
+ M 100644 :1 C:/invalid-path
+ INPUT_END
+
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
+ test_must_fail git fast-import <input
+'
+
+test_expect_success 'B: fail on invalid file path of .git' '
+ cat >input <<-INPUT_END &&
+ blob
+ mark :1
+ data <<EOF
+ File contents
+ EOF
+
+ commit refs/heads/badpath
+ committer Name <email> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ Commit Message
+ COMMIT
+ M 100644 :1 .git/invalid-path
+ INPUT_END
+
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
+ test_must_fail git fast-import <input
+'
+
+test_expect_success 'B: fail on invalid file path of .gitmodules' '
+ cat >input <<-INPUT_END &&
+ blob
+ mark :1
+ data <<EOF
+ File contents
+ EOF
+
+ commit refs/heads/badpath
+ committer Name <email> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ Commit Message
+ COMMIT
+ M 120000 :1 .gitmodules
+ INPUT_END
+
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
+ test_must_fail git fast-import <input
+'
+
###
### series C
###
@@ -945,7 +1052,7 @@ test_expect_success 'L: verify internal tree sorting' '
:100644 100644 M ba
EXPECT_END
- git fast-import <input &&
+ git -c core.protectNTFS=false fast-import <input &&
GIT_PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev --raw L^ L >output &&
cut -d" " -f1,2,5 output >actual &&
test_cmp expect actual
@@ -3096,7 +3203,7 @@ test_path_eol_success () {
test_expect_success "S: paths at EOL with $test must work" '
test_when_finished "git branch -D S-path-eol" &&
- git fast-import --export-marks=marks.out <<-EOF >out 2>err &&
+ git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF >out 2>err &&
blob
mark :401
data <<BLOB
@@ -3205,7 +3312,7 @@ test_path_space_success () {
test_expect_success "S: paths before space with $test must work" '
test_when_finished "git branch -D S-path-space" &&
- git fast-import --export-marks=marks.out <<-EOF 2>err &&
+ git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF 2>err &&
blob
mark :401
data <<BLOB
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index aa33791b77..40427883ec 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -631,7 +631,7 @@ test_expect_success 'fast-export quotes pathnames' '
git rev-list HEAD >expect &&
git init result &&
cd result &&
- git fast-import <../export.out &&
+ git -c core.protectNTFS=false fast-import <../export.out &&
git rev-list HEAD >actual &&
test_cmp ../expect actual
)
diff --git a/t/t9835-git-p4-metadata-encoding-python2.sh b/t/t9835-git-p4-metadata-encoding-python2.sh
index 036bf79c66..6116f806f6 100755
--- a/t/t9835-git-p4-metadata-encoding-python2.sh
+++ b/t/t9835-git-p4-metadata-encoding-python2.sh
@@ -8,29 +8,29 @@ failing, and produces maximally sane output in git.'
. ./lib-git-p4.sh
-python_target_version='2'
-
###############################
## SECTION REPEATED IN t9836 ##
###############################
-# Please note: this test calls "git-p4.py" rather than "git-p4", because the
-# latter references a specific path so we can't easily force it to run under
-# the python version we need to.
-
-python_major_version=$(python -V 2>&1 | cut -c 8)
-python_target_binary=$(which python$python_target_version)
-if ! test "$python_major_version" = "$python_target_version" && test "$python_target_binary"
+# These tests are specific to Python 2. Write a custom script that executes
+# git-p4 directly with the Python 2 interpreter to ensure that we use that
+# version even if Git was compiled with Python 3.
+python_target_binary=$(which python2)
+if test -n "$python_target_binary"
then
mkdir temp_python
- PATH="$(pwd)/temp_python:$PATH" && export PATH
- ln -s $python_target_binary temp_python/python
+ PATH="$(pwd)/temp_python:$PATH"
+ export PATH
+
+ write_script temp_python/git-p4-python2 <<-EOF
+ exec "$python_target_binary" "$(git --exec-path)/git-p4" "\$@"
+ EOF
fi
-python_major_version=$(python -V 2>&1 | cut -c 8)
-if ! test "$python_major_version" = "$python_target_version"
+git p4-python2 >err
+if ! grep 'valid commands' err
then
- skip_all="skipping python$python_target_version-specific git p4 tests; python$python_target_version not available"
+ skip_all="skipping python2 git p4 tests; python2 not available"
test_done
fi
@@ -81,14 +81,14 @@ test_expect_success 'init depot' '
test_expect_success 'clone non-utf8 repo with strict encoding' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4.py clone --dest="$git" //depot@all 2>err &&
+ test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4-python2 clone --dest="$git" //depot@all 2>err &&
grep "Decoding perforce metadata failed!" err
'
test_expect_success 'check utf-8 contents with passthrough strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=passthrough p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -100,7 +100,7 @@ test_expect_success 'check utf-8 contents with passthrough strategy' '
test_expect_success 'check latin-1 contents corrupted in git with passthrough strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=passthrough p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -114,7 +114,7 @@ test_expect_success 'check latin-1 contents corrupted in git with passthrough st
test_expect_success 'check utf-8 contents with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -126,7 +126,7 @@ test_expect_success 'check utf-8 contents with fallback strategy' '
test_expect_success 'check latin-1 contents with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -138,7 +138,7 @@ test_expect_success 'check latin-1 contents with fallback strategy' '
test_expect_success 'check cp-1252 contents with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -150,7 +150,7 @@ test_expect_success 'check cp-1252 contents with fallback strategy' '
test_expect_success 'check cp850 contents parsed with correct fallback' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -162,7 +162,7 @@ test_expect_success 'check cp850 contents parsed with correct fallback' '
test_expect_success 'check cp850-only contents escaped when cp1252 is fallback' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -174,7 +174,7 @@ test_expect_success 'check cp850-only contents escaped when cp1252 is fallback'
test_expect_success 'check cp-1252 contents on later sync after clone with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python2 clone --dest="$git" //depot@all &&
(
cd "$cli" &&
P4USER=cp1252_author &&
@@ -186,7 +186,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb
(
cd "$git" &&
- git p4.py sync --branch=master &&
+ git p4-python2 sync --branch=master &&
git log p4/master >actual &&
grep "sœme more cp-1252 tæxt" actual &&
@@ -201,7 +201,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb
test_expect_success 'passthrough (latin-1 contents corrupted in git) is the default with python2' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=passthrough p4-python2 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
diff --git a/t/t9836-git-p4-metadata-encoding-python3.sh b/t/t9836-git-p4-metadata-encoding-python3.sh
index 63350dc4b5..5e5217a66b 100755
--- a/t/t9836-git-p4-metadata-encoding-python3.sh
+++ b/t/t9836-git-p4-metadata-encoding-python3.sh
@@ -8,29 +8,29 @@ failing, and produces maximally sane output in git.'
. ./lib-git-p4.sh
-python_target_version='3'
-
###############################
## SECTION REPEATED IN t9835 ##
###############################
-# Please note: this test calls "git-p4.py" rather than "git-p4", because the
-# latter references a specific path so we can't easily force it to run under
-# the python version we need to.
-
-python_major_version=$(python -V 2>&1 | cut -c 8)
-python_target_binary=$(which python$python_target_version)
-if ! test "$python_major_version" = "$python_target_version" && test "$python_target_binary"
+# These tests are specific to Python 3. Write a custom script that executes
+# git-p4 directly with the Python 3 interpreter to ensure that we use that
+# version even if Git was compiled with Python 2.
+python_target_binary=$(which python3)
+if test -n "$python_target_binary"
then
mkdir temp_python
- PATH="$(pwd)/temp_python:$PATH" && export PATH
- ln -s $python_target_binary temp_python/python
+ PATH="$(pwd)/temp_python:$PATH"
+ export PATH
+
+ write_script temp_python/git-p4-python3 <<-EOF
+ exec "$python_target_binary" "$(git --exec-path)/git-p4" "\$@"
+ EOF
fi
-python_major_version=$(python -V 2>&1 | cut -c 8)
-if ! test "$python_major_version" = "$python_target_version"
+git p4-python3 >err
+if ! grep 'valid commands' err
then
- skip_all="skipping python$python_target_version-specific git p4 tests; python$python_target_version not available"
+ skip_all="skipping python3 git p4 tests; python3 not available"
test_done
fi
@@ -81,14 +81,14 @@ test_expect_success 'init depot' '
test_expect_success 'clone non-utf8 repo with strict encoding' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4.py clone --dest="$git" //depot@all 2>err &&
+ test_must_fail git -c git-p4.metadataDecodingStrategy=strict p4-python3 clone --dest="$git" //depot@all 2>err &&
grep "Decoding perforce metadata failed!" err
'
test_expect_success 'check utf-8 contents with passthrough strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=passthrough p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -100,7 +100,7 @@ test_expect_success 'check utf-8 contents with passthrough strategy' '
test_expect_success 'check latin-1 contents corrupted in git with passthrough strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=passthrough p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=passthrough p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -114,7 +114,7 @@ test_expect_success 'check latin-1 contents corrupted in git with passthrough st
test_expect_success 'check utf-8 contents with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -126,7 +126,7 @@ test_expect_success 'check utf-8 contents with fallback strategy' '
test_expect_success 'check latin-1 contents with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -138,7 +138,7 @@ test_expect_success 'check latin-1 contents with fallback strategy' '
test_expect_success 'check cp-1252 contents with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -150,7 +150,7 @@ test_expect_success 'check cp-1252 contents with fallback strategy' '
test_expect_success 'check cp850 contents parsed with correct fallback' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback -c git-p4.metadataFallbackEncoding=cp850 p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -162,7 +162,7 @@ test_expect_success 'check cp850 contents parsed with correct fallback' '
test_expect_success 'check cp850-only contents escaped when cp1252 is fallback' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
@@ -174,7 +174,7 @@ test_expect_success 'check cp850-only contents escaped when cp1252 is fallback'
test_expect_success 'check cp-1252 contents on later sync after clone with fallback strategy' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git -c git-p4.metadataDecodingStrategy=fallback p4.py clone --dest="$git" //depot@all &&
+ git -c git-p4.metadataDecodingStrategy=fallback p4-python3 clone --dest="$git" //depot@all &&
(
cd "$cli" &&
P4USER=cp1252_author &&
@@ -186,7 +186,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb
(
cd "$git" &&
- git p4.py sync --branch=master &&
+ git p4-python3 sync --branch=master &&
git log p4/master >actual &&
grep "sœme more cp-1252 tæxt" actual &&
@@ -202,7 +202,7 @@ test_expect_success 'check cp-1252 contents on later sync after clone with fallb
test_expect_success 'fallback (both utf-8 and cp-1252 contents handled) is the default with python3' '
test_when_finished cleanup_git &&
test_when_finished remove_user_cache &&
- git p4.py clone --dest="$git" //depot@all &&
+ git p4-python3 clone --dest="$git" //depot@all &&
(
cd "$git" &&
git log >actual &&
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 932d5ad759..51bd750837 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -657,6 +657,7 @@ test_expect_success '__git_refs - simple' '
HEAD
main
matching-branch
+ other/HEAD
other/branch-in-other
other/main-in-other
matching-tag
@@ -672,6 +673,7 @@ test_expect_success '__git_refs - full refs' '
cat >expected <<-EOF &&
refs/heads/main
refs/heads/matching-branch
+ refs/remotes/other/HEAD
refs/remotes/other/branch-in-other
refs/remotes/other/main-in-other
refs/tags/matching-tag
@@ -728,6 +730,7 @@ test_expect_success '__git_refs - remote on local file system - full refs' '
test_expect_success '__git_refs - configured remote' '
cat >expected <<-EOF &&
HEAD
+ HEAD
branch-in-other
main-in-other
EOF
@@ -755,6 +758,7 @@ test_expect_success '__git_refs - configured remote - full refs' '
test_expect_success '__git_refs - configured remote - repo given on the command line' '
cat >expected <<-EOF &&
HEAD
+ HEAD
branch-in-other
main-in-other
EOF
@@ -786,6 +790,7 @@ test_expect_success '__git_refs - configured remote - full refs - repo given on
test_expect_success '__git_refs - configured remote - remote name matches a directory' '
cat >expected <<-EOF &&
HEAD
+ HEAD
branch-in-other
main-in-other
EOF
@@ -874,12 +879,14 @@ test_expect_success '__git_refs - unique remote branches for git checkout DWIMer
HEAD
main
matching-branch
+ other/HEAD
other/ambiguous
other/branch-in-other
other/main-in-other
remote/ambiguous
remote/branch-in-remote
matching-tag
+ HEAD
branch-in-other
branch-in-remote
main-in-other
@@ -903,6 +910,7 @@ test_expect_success '__git_refs - after --opt=' '
HEAD
main
matching-branch
+ other/HEAD
other/branch-in-other
other/main-in-other
matching-tag
@@ -918,6 +926,7 @@ test_expect_success '__git_refs - after --opt= - full refs' '
cat >expected <<-EOF &&
refs/heads/main
refs/heads/matching-branch
+ refs/remotes/other/HEAD
refs/remotes/other/branch-in-other
refs/remotes/other/main-in-other
refs/tags/matching-tag
@@ -934,6 +943,7 @@ test_expect_success '__git refs - excluding refs' '
^HEAD
^main
^matching-branch
+ ^other/HEAD
^other/branch-in-other
^other/main-in-other
^matching-tag
@@ -949,6 +959,7 @@ test_expect_success '__git refs - excluding full refs' '
cat >expected <<-EOF &&
^refs/heads/main
^refs/heads/matching-branch
+ ^refs/remotes/other/HEAD
^refs/remotes/other/branch-in-other
^refs/remotes/other/main-in-other
^refs/tags/matching-tag
@@ -974,6 +985,7 @@ test_expect_success '__git_refs - do not filter refs unless told so' '
main
matching-branch
matching/branch
+ other/HEAD
other/branch-in-other
other/main-in-other
other/matching/branch-in-other
@@ -1094,6 +1106,7 @@ test_expect_success '__git_complete_refs - simple' '
HEAD Z
main Z
matching-branch Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
matching-tag Z
@@ -1122,6 +1135,7 @@ test_expect_success '__git_complete_refs - matching' '
test_expect_success '__git_complete_refs - remote' '
sed -e "s/Z$//" >expected <<-EOF &&
HEAD Z
+ HEAD Z
branch-in-other Z
main-in-other Z
EOF
@@ -1138,9 +1152,11 @@ test_expect_success '__git_complete_refs - track' '
HEAD Z
main Z
matching-branch Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
matching-tag Z
+ HEAD Z
branch-in-other Z
main-in-other Z
EOF
@@ -1183,6 +1199,7 @@ test_expect_success '__git_complete_refs - suffix' '
HEAD.
main.
matching-branch.
+ other/HEAD.
other/branch-in-other.
other/main-in-other.
matching-tag.
@@ -1198,6 +1215,7 @@ test_expect_success '__git_complete_refs - suffix' '
test_expect_success '__git_complete_fetch_refspecs - simple' '
sed -e "s/Z$//" >expected <<-EOF &&
HEAD:HEAD Z
+ HEAD:HEAD Z
branch-in-other:branch-in-other Z
main-in-other:main-in-other Z
EOF
@@ -1224,6 +1242,7 @@ test_expect_success '__git_complete_fetch_refspecs - matching' '
test_expect_success '__git_complete_fetch_refspecs - prefix' '
sed -e "s/Z$//" >expected <<-EOF &&
+HEAD:HEAD Z
+ +HEAD:HEAD Z
+branch-in-other:branch-in-other Z
+main-in-other:main-in-other Z
EOF
@@ -1288,6 +1307,7 @@ test_expect_success '__git_complete_worktree_paths with -C' '
test_expect_success 'git switch - with no options, complete local branches and unique remote branch names for DWIM logic' '
test_completion "git switch " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -1434,11 +1454,13 @@ test_expect_success 'git-bisect - existing view subcommand is recognized and ena
test_expect_success 'git checkout - completes refs and unique remote branches for DWIM' '
test_completion "git checkout " <<-\EOF
HEAD Z
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1460,6 +1482,7 @@ test_expect_success 'git switch - with GIT_COMPLETION_CHECKOUT_NO_GUESS=1, compl
test_expect_success 'git switch - --guess overrides GIT_COMPLETION_CHECKOUT_NO_GUESS=1, complete local branches and unique remote names for DWIM logic' '
GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git switch --guess " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -1469,6 +1492,7 @@ test_expect_success 'git switch - --guess overrides GIT_COMPLETION_CHECKOUT_NO_G
test_expect_success 'git switch - a later --guess overrides previous --no-guess, complete local and remote unique branches for DWIM' '
test_completion "git switch --no-guess --guess " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -1489,6 +1513,7 @@ test_expect_success 'git checkout - with GIT_COMPLETION_NO_GUESS=1 only complete
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1497,11 +1522,13 @@ test_expect_success 'git checkout - with GIT_COMPLETION_NO_GUESS=1 only complete
test_expect_success 'git checkout - --guess overrides GIT_COMPLETION_NO_GUESS=1, complete refs and unique remote branches for DWIM' '
GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git checkout --guess " <<-\EOF
HEAD Z
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1513,6 +1540,7 @@ test_expect_success 'git checkout - with --no-guess, only completes refs' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1521,11 +1549,13 @@ test_expect_success 'git checkout - with --no-guess, only completes refs' '
test_expect_success 'git checkout - a later --guess overrides previous --no-guess, complete refs and unique remote branches for DWIM' '
test_completion "git checkout --no-guess --guess " <<-\EOF
HEAD Z
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1537,6 +1567,7 @@ test_expect_success 'git checkout - a later --no-guess overrides previous --gues
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1549,6 +1580,7 @@ test_expect_success 'git checkout - with checkout.guess = false, only completes
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1558,11 +1590,13 @@ test_expect_success 'git checkout - with checkout.guess = true, completes refs a
test_config checkout.guess true &&
test_completion "git checkout " <<-\EOF
HEAD Z
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1572,11 +1606,13 @@ test_expect_success 'git checkout - a later --guess overrides previous checkout.
test_config checkout.guess false &&
test_completion "git checkout --guess " <<-\EOF
HEAD Z
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1589,6 +1625,7 @@ test_expect_success 'git checkout - a later --no-guess overrides previous checko
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1600,6 +1637,7 @@ test_expect_success 'git switch - with --detach, complete all references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1611,6 +1649,7 @@ test_expect_success 'git checkout - with --detach, complete only references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1782,6 +1821,7 @@ test_expect_success 'git switch - with -d, complete all references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1793,6 +1833,7 @@ test_expect_success 'git checkout - with -d, complete only references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1800,10 +1841,12 @@ test_expect_success 'git checkout - with -d, complete only references' '
test_expect_success 'git switch - with --track, complete only remote branches' '
test_completion "git switch --track " <<-\EOF &&
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
test_completion "git switch -t " <<-\EOF
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1811,10 +1854,12 @@ test_expect_success 'git switch - with --track, complete only remote branches' '
test_expect_success 'git checkout - with --track, complete only remote branches' '
test_completion "git checkout --track " <<-\EOF &&
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
test_completion "git checkout -t " <<-\EOF
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1833,6 +1878,7 @@ test_expect_success 'git checkout - with --no-track, complete only local referen
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1844,6 +1890,7 @@ test_expect_success 'git switch - with -c, complete all references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1855,6 +1902,7 @@ test_expect_success 'git switch - with -C, complete all references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1866,6 +1914,7 @@ test_expect_success 'git switch - with -c and --track, complete all references'
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1877,6 +1926,7 @@ test_expect_success 'git switch - with -C and --track, complete all references'
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1888,6 +1938,7 @@ test_expect_success 'git switch - with -c and --no-track, complete all reference
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1899,6 +1950,7 @@ test_expect_success 'git switch - with -C and --no-track, complete all reference
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1910,6 +1962,7 @@ test_expect_success 'git checkout - with -b, complete all references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1921,6 +1974,7 @@ test_expect_success 'git checkout - with -B, complete all references' '
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1932,6 +1986,7 @@ test_expect_success 'git checkout - with -b and --track, complete all references
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1943,6 +1998,7 @@ test_expect_success 'git checkout - with -B and --track, complete all references
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1954,6 +2010,7 @@ test_expect_success 'git checkout - with -b and --no-track, complete all referen
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1965,6 +2022,7 @@ test_expect_success 'git checkout - with -B and --no-track, complete all referen
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
@@ -1972,6 +2030,7 @@ test_expect_success 'git checkout - with -B and --no-track, complete all referen
test_expect_success 'git switch - for -c, complete local branches and unique remote branches' '
test_completion "git switch -c " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -1981,6 +2040,7 @@ test_expect_success 'git switch - for -c, complete local branches and unique rem
test_expect_success 'git switch - for -C, complete local branches and unique remote branches' '
test_completion "git switch -C " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -2018,6 +2078,7 @@ test_expect_success 'git switch - for -C with --no-track, complete local branche
test_expect_success 'git checkout - for -b, complete local branches and unique remote branches' '
test_completion "git checkout -b " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -2027,6 +2088,7 @@ test_expect_success 'git checkout - for -b, complete local branches and unique r
test_expect_success 'git checkout - for -B, complete local branches and unique remote branches' '
test_completion "git checkout -B " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -2064,6 +2126,7 @@ test_expect_success 'git checkout - for -B with --no-track, complete local branc
test_expect_success 'git switch - with --orphan completes local branch names and unique remote branch names' '
test_completion "git switch --orphan " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -2079,6 +2142,7 @@ test_expect_success 'git switch - --orphan with branch already provided complete
test_expect_success 'git checkout - with --orphan completes local branch names and unique remote branch names' '
test_completion "git checkout --orphan " <<-\EOF
+ HEAD Z
branch-in-other Z
main Z
main-in-other Z
@@ -2092,6 +2156,7 @@ test_expect_success 'git checkout - --orphan with branch already provided comple
main Z
matching-branch Z
matching-tag Z
+ other/HEAD Z
other/branch-in-other Z
other/main-in-other Z
EOF
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 78e054ab50..14d511f509 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -927,7 +927,7 @@ test_expect_success () {
test -n "$test_skip_test_preamble" ||
say >&3 "expecting success of $TEST_NUMBER.$test_count '$1': $test_body"
if test_run_ "$test_body" &&
- check_test_results_san_file_empty_
+ ! check_test_results_san_file_has_entries_
then
test_ok_ "$1"
else
@@ -1268,6 +1268,16 @@ test_cmp () {
eval "$GIT_TEST_CMP" '"$@"'
}
+# test_cmp_sorted runs test_cmp on sorted versions of the two
+# input files. Uses "$1.sorted" and "$2.sorted" as temp files.
+
+test_cmp_sorted () {
+ sort <"$1" >"$1.sorted" &&
+ sort <"$2" >"$2.sorted" &&
+ test_cmp "$1.sorted" "$2.sorted" &&
+ rm "$1.sorted" "$2.sorted"
+}
+
# Check that the given config key has the expected value.
#
# test_cmp_config [-C <dir>] <expected-value>
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 426036b33a..9f27a49995 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -35,13 +35,7 @@ else
# needing to exist.
TEST_DIRECTORY=$(cd "$TEST_DIRECTORY" && pwd) || exit 1
fi
-if test -z "$TEST_OUTPUT_DIRECTORY"
-then
- # Similarly, override this to store the test-results subdir
- # elsewhere
- TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY
-fi
-GIT_BUILD_DIR="${TEST_DIRECTORY%/t}"
+GIT_BUILD_DIR="${GIT_BUILD_DIR:-${TEST_DIRECTORY%/t}}"
if test "$TEST_DIRECTORY" = "$GIT_BUILD_DIR"
then
echo "PANIC: Running in a $TEST_DIRECTORY that doesn't end in '/t'?" >&2
@@ -86,12 +80,22 @@ prepend_var ASAN_OPTIONS : detect_leaks=0
export ASAN_OPTIONS
prepend_var LSAN_OPTIONS : $GIT_SAN_OPTIONS
+prepend_var LSAN_OPTIONS : exitcode=0
prepend_var LSAN_OPTIONS : fast_unwind_on_malloc=0
export LSAN_OPTIONS
prepend_var UBSAN_OPTIONS : $GIT_SAN_OPTIONS
export UBSAN_OPTIONS
+# The TEST_OUTPUT_DIRECTORY will be overwritten via GIT-BUILD-OPTIONS. So in
+# case the caller has manually set up this variable via the environment we must
+# make sure to not overwrite that value, and thus we save it into
+# TEST_OUTPUT_DIRECTORY_OVERRIDE here.
+if test -n "$TEST_OUTPUT_DIRECTORY" && test -z "$TEST_OUTPUT_DIRECTORY_OVERRIDE"
+then
+ TEST_OUTPUT_DIRECTORY_OVERRIDE=$TEST_OUTPUT_DIRECTORY
+fi
+
if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
then
echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
@@ -100,6 +104,13 @@ fi
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
export PERL_PATH SHELL_PATH
+if test -z "$TEST_OUTPUT_DIRECTORY"
+then
+ # Similarly, override this to store the test-results subdir
+ # elsewhere
+ TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY
+fi
+
# In t0000, we need to override test directories of nested testcases. In case
# the developer has TEST_OUTPUT_DIRECTORY part of his build options, then we'd
# reset this value to instead contain what the developer has specified. We thus
@@ -321,7 +332,7 @@ TEST_RESULTS_BASE="$TEST_RESULTS_DIR/$TEST_NAME$TEST_STRESS_JOB_SFX"
TEST_RESULTS_SAN_FILE_PFX=trace
TEST_RESULTS_SAN_DIR_SFX=leak
TEST_RESULTS_SAN_FILE=
-TEST_RESULTS_SAN_DIR="$TEST_RESULTS_DIR/$TEST_NAME.$TEST_RESULTS_SAN_DIR_SFX"
+TEST_RESULTS_SAN_DIR="$TEST_RESULTS_BASE.$TEST_RESULTS_SAN_DIR_SFX"
TRASH_DIRECTORY="trash directory.$TEST_NAME$TEST_STRESS_JOB_SFX"
test -n "$root" && TRASH_DIRECTORY="$root/$TRASH_DIRECTORY"
case "$TRASH_DIRECTORY" in
@@ -329,17 +340,6 @@ case "$TRASH_DIRECTORY" in
*) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
esac
-# Utility functions using $TEST_RESULTS_* variables
-nr_san_dir_leaks_ () {
- # stderr piped to /dev/null because the directory may have
- # been "rmdir"'d already.
- find "$TEST_RESULTS_SAN_DIR" \
- -type f \
- -name "$TEST_RESULTS_SAN_FILE_PFX.*" 2>/dev/null |
- xargs grep -lv "Unable to get registers from thread" |
- wc -l
-}
-
# If --stress was passed, run this test repeatedly in several parallel loops.
if test "$GIT_TEST_STRESS_STARTED" = "done"
then
@@ -512,6 +512,7 @@ unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
PERF_
CURL_VERBOSE
TRACE_CURL
+ BUILD_DIR
));
my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
print join("\n", @vars);
@@ -1168,13 +1169,20 @@ test_atexit_handler () {
teardown_malloc_check
}
-check_test_results_san_file_empty_ () {
- test -z "$TEST_RESULTS_SAN_FILE" ||
- test "$(nr_san_dir_leaks_)" = 0
+check_test_results_san_file_has_entries_ () {
+ test -z "$TEST_RESULTS_SAN_FILE" && return 1
+
+ # Lines marked with DEDUP_TOKEN show unique leaks. We only care that we
+ # found at least one.
+ #
+ # But also suppress any false positives caused by bugs or races in the
+ # sanitizer itself.
+ grep -s ^DEDUP_TOKEN "$TEST_RESULTS_SAN_FILE".* |
+ grep -qv sanitizer::GetThreadStackTopAndBottom
}
check_test_results_san_file_ () {
- if check_test_results_san_file_empty_
+ if ! check_test_results_san_file_has_entries_
then
return
fi &&
@@ -1409,7 +1417,7 @@ else # normal case, use ../bin-wrappers only unless $with_dashes:
PATH="$GIT_BUILD_DIR:$GIT_BUILD_DIR/t/helper:$PATH"
fi
fi
-GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt
+GIT_TEMPLATE_DIR="$GIT_TEST_TEMPLATE_DIR"
GIT_CONFIG_NOSYSTEM=1
GIT_ATTR_NOSYSTEM=1
GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY/.."
@@ -1475,9 +1483,9 @@ then
fi
fi
-GITPERLLIB="$GIT_BUILD_DIR"/perl/build/lib
+GITPERLLIB="$GIT_TEST_GITPERLLIB"
export GITPERLLIB
-test -d "$GIT_BUILD_DIR"/templates/blt || {
+test -d "$GIT_TEMPLATE_DIR" || {
BAIL_OUT "You haven't built things yet, have you?"
}
@@ -1676,6 +1684,7 @@ esac
( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
test -z "$NO_CURL" && test_set_prereq LIBCURL
+test -z "$NO_GITWEB" && test_set_prereq GITWEB
test -z "$NO_ICONV" && test_set_prereq ICONV
test -z "$NO_PERL" && test_set_prereq PERL
test -z "$NO_PTHREADS" && test_set_prereq PTHREADS
diff --git a/t/unit-tests/generate-clar-decls.sh b/t/unit-tests/generate-clar-decls.sh
index 688e0885f4..abf6a2ea2a 100755
--- a/t/unit-tests/generate-clar-decls.sh
+++ b/t/unit-tests/generate-clar-decls.sh
@@ -11,6 +11,10 @@ shift
for suite in "$@"
do
- sed -ne "s/^\(void test_$(basename "${suite%.c}")__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" ||
+ suite_name=$(basename "$suite")
+ suite_name=${suite_name%.c}
+ suite_name=${suite_name#u-}
+ suite_name=$(echo "$suite_name" | tr '-' '_')
+ sed -ne "s/^\(void test_${suite_name}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" ||
exit 1
done >"$OUTPUT"
diff --git a/t/unit-tests/lib-reftable.c b/t/unit-tests/lib-reftable.c
index 2ddf480588..8a69612266 100644
--- a/t/unit-tests/lib-reftable.c
+++ b/t/unit-tests/lib-reftable.c
@@ -1,9 +1,12 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "lib-reftable.h"
#include "test-lib.h"
#include "reftable/constants.h"
#include "reftable/writer.h"
+#include "strbuf.h"
-void t_reftable_set_hash(uint8_t *p, int i, uint32_t id)
+void t_reftable_set_hash(uint8_t *p, int i, enum reftable_hash id)
{
memset(p, (uint8_t)i, hash_size(id));
}
@@ -82,7 +85,7 @@ void t_reftable_write_to_buf(struct reftable_buf *buf,
size_t off = i * (opts.block_size ? opts.block_size
: DEFAULT_BLOCK_SIZE);
if (!off)
- off = header_size(opts.hash_id == GIT_SHA256_FORMAT_ID ? 2 : 1);
+ off = header_size(opts.hash_id == REFTABLE_HASH_SHA256 ? 2 : 1);
check_char(buf->buf[off], ==, 'r');
}
diff --git a/t/unit-tests/lib-reftable.h b/t/unit-tests/lib-reftable.h
index d4950fed3d..e4c360fa7e 100644
--- a/t/unit-tests/lib-reftable.h
+++ b/t/unit-tests/lib-reftable.h
@@ -6,7 +6,7 @@
struct reftable_buf;
-void t_reftable_set_hash(uint8_t *p, int i, uint32_t id);
+void t_reftable_set_hash(uint8_t *p, int i, enum reftable_hash id);
struct reftable_writer *t_reftable_strbuf_writer(struct reftable_buf *buf,
struct reftable_write_options *opts);
diff --git a/t/unit-tests/t-example-decorate.c b/t/unit-tests/t-example-decorate.c
index 8bf0709c41..bfc776e223 100644
--- a/t/unit-tests/t-example-decorate.c
+++ b/t/unit-tests/t-example-decorate.c
@@ -42,9 +42,9 @@ static void t_lookup(struct test_vars *vars)
static void t_loop(struct test_vars *vars)
{
- int i, objects_noticed = 0;
+ int objects_noticed = 0;
- for (i = 0; i < vars->n.size; i++) {
+ for (size_t i = 0; i < vars->n.size; i++) {
if (vars->n.entries[i].base)
objects_noticed++;
}
diff --git a/t/unit-tests/t-mem-pool.c b/t/unit-tests/t-mem-pool.c
deleted file mode 100644
index fe500c704b..0000000000
--- a/t/unit-tests/t-mem-pool.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "test-lib.h"
-#include "mem-pool.h"
-
-static void setup_static(void (*f)(struct mem_pool *), size_t block_alloc)
-{
- struct mem_pool pool = { .block_alloc = block_alloc };
- f(&pool);
- mem_pool_discard(&pool, 0);
-}
-
-static void t_calloc_100(struct mem_pool *pool)
-{
- size_t size = 100;
- char *buffer = mem_pool_calloc(pool, 1, size);
- for (size_t i = 0; i < size; i++)
- check_int(buffer[i], ==, 0);
- if (!check(pool->mp_block != NULL))
- return;
- check(pool->mp_block->next_free != NULL);
- check(pool->mp_block->end != NULL);
-}
-
-int cmd_main(int argc UNUSED, const char **argv UNUSED)
-{
- TEST(setup_static(t_calloc_100, 1024 * 1024),
- "mem_pool_calloc returns 100 zeroed bytes with big block");
- TEST(setup_static(t_calloc_100, 1),
- "mem_pool_calloc returns 100 zeroed bytes with tiny block");
-
- return test_done();
-}
diff --git a/t/unit-tests/t-prio-queue.c b/t/unit-tests/t-prio-queue.c
deleted file mode 100644
index fe6ae37935..0000000000
--- a/t/unit-tests/t-prio-queue.c
+++ /dev/null
@@ -1,91 +0,0 @@
-#include "test-lib.h"
-#include "prio-queue.h"
-
-static int intcmp(const void *va, const void *vb, void *data UNUSED)
-{
- const int *a = va, *b = vb;
- return *a - *b;
-}
-
-
-#define MISSING -1
-#define DUMP -2
-#define STACK -3
-#define GET -4
-#define REVERSE -5
-
-static int show(int *v)
-{
- return v ? *v : MISSING;
-}
-
-static void test_prio_queue(int *input, size_t input_size,
- int *result, size_t result_size)
-{
- struct prio_queue pq = { intcmp };
- int j = 0;
-
- for (int i = 0; i < input_size; i++) {
- void *peek, *get;
- switch(input[i]) {
- case GET:
- peek = prio_queue_peek(&pq);
- get = prio_queue_get(&pq);
- if (!check(peek == get))
- return;
- if (!check_uint(j, <, result_size))
- break;
- if (!check_int(result[j], ==, show(get)))
- test_msg(" j: %d", j);
- j++;
- break;
- case DUMP:
- while ((peek = prio_queue_peek(&pq))) {
- get = prio_queue_get(&pq);
- if (!check(peek == get))
- return;
- if (!check_uint(j, <, result_size))
- break;
- if (!check_int(result[j], ==, show(get)))
- test_msg(" j: %d", j);
- j++;
- }
- break;
- case STACK:
- pq.compare = NULL;
- break;
- case REVERSE:
- prio_queue_reverse(&pq);
- break;
- default:
- prio_queue_put(&pq, &input[i]);
- break;
- }
- }
- check_uint(j, ==, result_size);
- clear_prio_queue(&pq);
-}
-
-#define TEST_INPUT(input, result) \
- test_prio_queue(input, ARRAY_SIZE(input), result, ARRAY_SIZE(result))
-
-int cmd_main(int argc UNUSED, const char **argv UNUSED)
-{
- TEST(TEST_INPUT(((int []){ 2, 6, 3, 10, 9, 5, 7, 4, 5, 8, 1, DUMP }),
- ((int []){ 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10 })),
- "prio-queue works for basic input");
- TEST(TEST_INPUT(((int []){ 6, 2, 4, GET, 5, 3, GET, GET, 1, DUMP }),
- ((int []){ 2, 3, 4, 1, 5, 6 })),
- "prio-queue works for mixed put & get commands");
- TEST(TEST_INPUT(((int []){ 1, 2, GET, GET, GET, 1, 2, GET, GET, GET }),
- ((int []){ 1, 2, MISSING, 1, 2, MISSING })),
- "prio-queue works when queue is empty");
- TEST(TEST_INPUT(((int []){ STACK, 8, 1, 5, 4, 6, 2, 3, DUMP }),
- ((int []){ 3, 2, 6, 4, 5, 1, 8 })),
- "prio-queue works when used as a LIFO stack");
- TEST(TEST_INPUT(((int []){ STACK, 1, 2, 3, 4, 5, 6, REVERSE, DUMP }),
- ((int []){ 1, 2, 3, 4, 5, 6 })),
- "prio-queue works when LIFO stack is reversed");
-
- return test_done();
-}
diff --git a/t/unit-tests/t-reftable-basics.c b/t/unit-tests/t-reftable-basics.c
index 65d50df091..9ba7eb05ad 100644
--- a/t/unit-tests/t-reftable-basics.c
+++ b/t/unit-tests/t-reftable-basics.c
@@ -20,6 +20,11 @@ static int integer_needle_lesseq(size_t i, void *_args)
return args->needle <= args->haystack[i];
}
+static void *realloc_stub(void *p UNUSED, size_t size UNUSED)
+{
+ return NULL;
+}
+
int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
{
if_test ("binary search with binsearch works") {
@@ -115,7 +120,7 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
for (size_t i = 0; i < ARRAY_SIZE(cases); i++) {
check(!reftable_buf_addstr(&a, cases[i].a));
check(!reftable_buf_addstr(&b, cases[i].b));
- check_int(common_prefix_size(&a, &b), ==, cases[i].want);
+ check_uint(common_prefix_size(&a, &b), ==, cases[i].want);
reftable_buf_reset(&a);
reftable_buf_reset(&b);
}
@@ -141,5 +146,56 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
check_int(in, ==, out);
}
+ if_test ("REFTABLE_ALLOC_GROW works") {
+ int *arr = NULL, *old_arr;
+ size_t alloc = 0, old_alloc;
+
+ check(!REFTABLE_ALLOC_GROW(arr, 1, alloc));
+ check(arr != NULL);
+ check_uint(alloc, >=, 1);
+ arr[0] = 42;
+
+ old_alloc = alloc;
+ old_arr = arr;
+ reftable_set_alloc(NULL, realloc_stub, NULL);
+ check(REFTABLE_ALLOC_GROW(arr, old_alloc + 1, alloc));
+ check(arr == old_arr);
+ check_uint(alloc, ==, old_alloc);
+
+ old_alloc = alloc;
+ reftable_set_alloc(NULL, NULL, NULL);
+ check(!REFTABLE_ALLOC_GROW(arr, old_alloc + 1, alloc));
+ check(arr != NULL);
+ check_uint(alloc, >, old_alloc);
+ arr[alloc - 1] = 42;
+
+ reftable_free(arr);
+ }
+
+ if_test ("REFTABLE_ALLOC_GROW_OR_NULL works") {
+ int *arr = NULL;
+ size_t alloc = 0, old_alloc;
+
+ REFTABLE_ALLOC_GROW_OR_NULL(arr, 1, alloc);
+ check(arr != NULL);
+ check_uint(alloc, >=, 1);
+ arr[0] = 42;
+
+ old_alloc = alloc;
+ REFTABLE_ALLOC_GROW_OR_NULL(arr, old_alloc + 1, alloc);
+ check(arr != NULL);
+ check_uint(alloc, >, old_alloc);
+ arr[alloc - 1] = 42;
+
+ old_alloc = alloc;
+ reftable_set_alloc(NULL, realloc_stub, NULL);
+ REFTABLE_ALLOC_GROW_OR_NULL(arr, old_alloc + 1, alloc);
+ check(arr == NULL);
+ check_uint(alloc, ==, 0);
+ reftable_set_alloc(NULL, NULL, NULL);
+
+ reftable_free(arr);
+ }
+
return test_done();
}
diff --git a/t/unit-tests/t-reftable-block.c b/t/unit-tests/t-reftable-block.c
index f9af907117..22040aeefa 100644
--- a/t/unit-tests/t-reftable-block.c
+++ b/t/unit-tests/t-reftable-block.c
@@ -11,6 +11,7 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable/blocksource.h"
#include "reftable/constants.h"
#include "reftable/reftable-error.h"
+#include "strbuf.h"
static void t_ref_block_read_write(void)
{
@@ -36,7 +37,7 @@ static void t_ref_block_read_write(void)
block.len = block_size;
block_source_from_buf(&block.source ,&buf);
ret = block_writer_init(&bw, BLOCK_TYPE_REF, block.data, block_size,
- header_off, hash_size(GIT_SHA1_FORMAT_ID));
+ header_off, hash_size(REFTABLE_HASH_SHA1));
check(!ret);
rec.u.ref.refname = (char *) "";
@@ -47,7 +48,7 @@ static void t_ref_block_read_write(void)
for (i = 0; i < N; i++) {
rec.u.ref.refname = xstrfmt("branch%02"PRIuMAX, (uintmax_t)i);
rec.u.ref.value_type = REFTABLE_REF_VAL1;
- memset(rec.u.ref.value.val1, i, GIT_SHA1_RAWSZ);
+ memset(rec.u.ref.value.val1, i, REFTABLE_HASH_SIZE_SHA1);
recs[i] = rec;
ret = block_writer_add(&bw, &rec);
@@ -61,7 +62,7 @@ static void t_ref_block_read_write(void)
block_writer_release(&bw);
- block_reader_init(&br, &block, header_off, block_size, GIT_SHA1_RAWSZ);
+ block_reader_init(&br, &block, header_off, block_size, REFTABLE_HASH_SIZE_SHA1);
block_iter_seek_start(&it, &br);
@@ -72,7 +73,7 @@ static void t_ref_block_read_write(void)
check_int(i, ==, N);
break;
}
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
}
for (i = 0; i < N; i++) {
@@ -85,7 +86,7 @@ static void t_ref_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
want.len--;
ret = block_iter_seek_key(&it, &br, &want);
@@ -93,7 +94,7 @@ static void t_ref_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[10 * (i / 10)], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[10 * (i / 10)], &rec, REFTABLE_HASH_SIZE_SHA1));
}
block_reader_release(&br);
@@ -130,7 +131,7 @@ static void t_log_block_read_write(void)
block.len = block_size;
block_source_from_buf(&block.source ,&buf);
ret = block_writer_init(&bw, BLOCK_TYPE_LOG, block.data, block_size,
- header_off, hash_size(GIT_SHA1_FORMAT_ID));
+ header_off, hash_size(REFTABLE_HASH_SHA1));
check(!ret);
for (i = 0; i < N; i++) {
@@ -150,7 +151,7 @@ static void t_log_block_read_write(void)
block_writer_release(&bw);
- block_reader_init(&br, &block, header_off, block_size, GIT_SHA1_RAWSZ);
+ block_reader_init(&br, &block, header_off, block_size, REFTABLE_HASH_SIZE_SHA1);
block_iter_seek_start(&it, &br);
@@ -161,7 +162,7 @@ static void t_log_block_read_write(void)
check_int(i, ==, N);
break;
}
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
}
for (i = 0; i < N; i++) {
@@ -175,7 +176,7 @@ static void t_log_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
want.len--;
ret = block_iter_seek_key(&it, &br, &want);
@@ -183,7 +184,7 @@ static void t_log_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[10 * (i / 10)], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[10 * (i / 10)], &rec, REFTABLE_HASH_SIZE_SHA1));
}
block_reader_release(&br);
@@ -220,7 +221,7 @@ static void t_obj_block_read_write(void)
block.len = block_size;
block_source_from_buf(&block.source, &buf);
ret = block_writer_init(&bw, BLOCK_TYPE_OBJ, block.data, block_size,
- header_off, hash_size(GIT_SHA1_FORMAT_ID));
+ header_off, hash_size(REFTABLE_HASH_SHA1));
check(!ret);
for (i = 0; i < N; i++) {
@@ -242,7 +243,7 @@ static void t_obj_block_read_write(void)
block_writer_release(&bw);
- block_reader_init(&br, &block, header_off, block_size, GIT_SHA1_RAWSZ);
+ block_reader_init(&br, &block, header_off, block_size, REFTABLE_HASH_SIZE_SHA1);
block_iter_seek_start(&it, &br);
@@ -253,7 +254,7 @@ static void t_obj_block_read_write(void)
check_int(i, ==, N);
break;
}
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
}
for (i = 0; i < N; i++) {
@@ -266,7 +267,7 @@ static void t_obj_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
}
block_reader_release(&br);
@@ -304,7 +305,7 @@ static void t_index_block_read_write(void)
block.len = block_size;
block_source_from_buf(&block.source, &buf);
ret = block_writer_init(&bw, BLOCK_TYPE_INDEX, block.data, block_size,
- header_off, hash_size(GIT_SHA1_FORMAT_ID));
+ header_off, hash_size(REFTABLE_HASH_SHA1));
check(!ret);
for (i = 0; i < N; i++) {
@@ -326,7 +327,7 @@ static void t_index_block_read_write(void)
block_writer_release(&bw);
- block_reader_init(&br, &block, header_off, block_size, GIT_SHA1_RAWSZ);
+ block_reader_init(&br, &block, header_off, block_size, REFTABLE_HASH_SIZE_SHA1);
block_iter_seek_start(&it, &br);
@@ -337,7 +338,7 @@ static void t_index_block_read_write(void)
check_int(i, ==, N);
break;
}
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
}
for (i = 0; i < N; i++) {
@@ -350,7 +351,7 @@ static void t_index_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[i], &rec, REFTABLE_HASH_SIZE_SHA1));
want.len--;
ret = block_iter_seek_key(&it, &br, &want);
@@ -358,7 +359,7 @@ static void t_index_block_read_write(void)
ret = block_iter_next(&it, &rec);
check_int(ret, ==, 0);
- check(reftable_record_equal(&recs[10 * (i / 10)], &rec, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&recs[10 * (i / 10)], &rec, REFTABLE_HASH_SIZE_SHA1));
}
block_reader_release(&br);
diff --git a/t/unit-tests/t-reftable-merged.c b/t/unit-tests/t-reftable-merged.c
index 4c25ee5334..60836f80d6 100644
--- a/t/unit-tests/t-reftable-merged.c
+++ b/t/unit-tests/t-reftable-merged.c
@@ -42,7 +42,7 @@ merged_table_from_records(struct reftable_ref_record **refs,
check(!err);
}
- err = reftable_merged_table_new(&mt, *readers, n, GIT_SHA1_FORMAT_ID);
+ err = reftable_merged_table_new(&mt, *readers, n, REFTABLE_HASH_SHA1);
check(!err);
return mt;
}
@@ -91,7 +91,7 @@ static void t_merged_single_record(void)
err = reftable_iterator_next_ref(&it, &ref);
check(!err);
- check(reftable_ref_record_equal(&r2[0], &ref, GIT_SHA1_RAWSZ));
+ check(reftable_ref_record_equal(&r2[0], &ref, REFTABLE_HASH_SIZE_SHA1));
reftable_ref_record_release(&ref);
reftable_iterator_destroy(&it);
readers_destroy(readers, 3);
@@ -168,7 +168,7 @@ static void t_merged_refs(void)
check(!err);
err = reftable_iterator_seek_ref(&it, "a");
check(!err);
- check_int(reftable_merged_table_hash_id(mt), ==, GIT_SHA1_FORMAT_ID);
+ check_int(reftable_merged_table_hash_id(mt), ==, REFTABLE_HASH_SHA1);
check_int(reftable_merged_table_min_update_index(mt), ==, 1);
check_int(reftable_merged_table_max_update_index(mt), ==, 3);
@@ -178,7 +178,7 @@ static void t_merged_refs(void)
if (err > 0)
break;
- REFTABLE_ALLOC_GROW(out, len + 1, cap);
+ check(!REFTABLE_ALLOC_GROW(out, len + 1, cap));
out[len++] = ref;
}
reftable_iterator_destroy(&it);
@@ -186,7 +186,7 @@ static void t_merged_refs(void)
check_int(ARRAY_SIZE(want), ==, len);
for (i = 0; i < len; i++)
check(reftable_ref_record_equal(want[i], &out[i],
- GIT_SHA1_RAWSZ));
+ REFTABLE_HASH_SIZE_SHA1));
for (i = 0; i < len; i++)
reftable_ref_record_release(&out[i]);
reftable_free(out);
@@ -252,12 +252,12 @@ static void t_merged_seek_multiple_times(void)
err = reftable_iterator_next_ref(&it, &rec);
check(!err);
- err = reftable_ref_record_equal(&rec, &r1[1], GIT_SHA1_RAWSZ);
+ err = reftable_ref_record_equal(&rec, &r1[1], REFTABLE_HASH_SIZE_SHA1);
check(err == 1);
err = reftable_iterator_next_ref(&it, &rec);
check(!err);
- err = reftable_ref_record_equal(&rec, &r2[1], GIT_SHA1_RAWSZ);
+ err = reftable_ref_record_equal(&rec, &r2[1], REFTABLE_HASH_SIZE_SHA1);
check(err == 1);
err = reftable_iterator_next_ref(&it, &rec);
@@ -273,6 +273,78 @@ static void t_merged_seek_multiple_times(void)
reftable_free(sources);
}
+static void t_merged_seek_multiple_times_without_draining(void)
+{
+ struct reftable_ref_record r1[] = {
+ {
+ .refname = (char *) "a",
+ .update_index = 1,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = { 1 },
+ },
+ {
+ .refname = (char *) "c",
+ .update_index = 1,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = { 2 },
+ }
+ };
+ struct reftable_ref_record r2[] = {
+ {
+ .refname = (char *) "b",
+ .update_index = 2,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = { 3 },
+ },
+ {
+ .refname = (char *) "d",
+ .update_index = 2,
+ .value_type = REFTABLE_REF_VAL1,
+ .value.val1 = { 4 },
+ },
+ };
+ struct reftable_ref_record *refs[] = {
+ r1, r2,
+ };
+ size_t sizes[] = {
+ ARRAY_SIZE(r1), ARRAY_SIZE(r2),
+ };
+ struct reftable_buf bufs[] = {
+ REFTABLE_BUF_INIT, REFTABLE_BUF_INIT,
+ };
+ struct reftable_block_source *sources = NULL;
+ struct reftable_reader **readers = NULL;
+ struct reftable_ref_record rec = { 0 };
+ struct reftable_iterator it = { 0 };
+ struct reftable_merged_table *mt;
+ int err;
+
+ mt = merged_table_from_records(refs, &sources, &readers, sizes, bufs, 2);
+ merged_table_init_iter(mt, &it, BLOCK_TYPE_REF);
+
+ err = reftable_iterator_seek_ref(&it, "b");
+ check(!err);
+ err = reftable_iterator_next_ref(&it, &rec);
+ check(!err);
+ err = reftable_ref_record_equal(&rec, &r2[0], REFTABLE_HASH_SIZE_SHA1);
+ check(err == 1);
+
+ err = reftable_iterator_seek_ref(&it, "a");
+ check(!err);
+ err = reftable_iterator_next_ref(&it, &rec);
+ check(!err);
+ err = reftable_ref_record_equal(&rec, &r1[0], REFTABLE_HASH_SIZE_SHA1);
+ check(err == 1);
+
+ for (size_t i = 0; i < ARRAY_SIZE(bufs); i++)
+ reftable_buf_release(&bufs[i]);
+ readers_destroy(readers, ARRAY_SIZE(refs));
+ reftable_ref_record_release(&rec);
+ reftable_iterator_destroy(&it);
+ reftable_merged_table_free(mt);
+ reftable_free(sources);
+}
+
static struct reftable_merged_table *
merged_table_from_log_records(struct reftable_log_record **logs,
struct reftable_block_source **source,
@@ -300,7 +372,7 @@ merged_table_from_log_records(struct reftable_log_record **logs,
check(!err);
}
- err = reftable_merged_table_new(&mt, *readers, n, GIT_SHA1_FORMAT_ID);
+ err = reftable_merged_table_new(&mt, *readers, n, REFTABLE_HASH_SHA1);
check(!err);
return mt;
}
@@ -377,7 +449,7 @@ static void t_merged_logs(void)
check(!err);
err = reftable_iterator_seek_log(&it, "a");
check(!err);
- check_int(reftable_merged_table_hash_id(mt), ==, GIT_SHA1_FORMAT_ID);
+ check_int(reftable_merged_table_hash_id(mt), ==, REFTABLE_HASH_SHA1);
check_int(reftable_merged_table_min_update_index(mt), ==, 1);
check_int(reftable_merged_table_max_update_index(mt), ==, 3);
@@ -387,7 +459,7 @@ static void t_merged_logs(void)
if (err > 0)
break;
- REFTABLE_ALLOC_GROW(out, len + 1, cap);
+ check(!REFTABLE_ALLOC_GROW(out, len + 1, cap));
out[len++] = log;
}
reftable_iterator_destroy(&it);
@@ -395,7 +467,7 @@ static void t_merged_logs(void)
check_int(ARRAY_SIZE(want), ==, len);
for (i = 0; i < len; i++)
check(reftable_log_record_equal(want[i], &out[i],
- GIT_SHA1_RAWSZ));
+ REFTABLE_HASH_SIZE_SHA1));
err = merged_table_init_iter(mt, &it, BLOCK_TYPE_LOG);
check(!err);
@@ -404,7 +476,7 @@ static void t_merged_logs(void)
reftable_log_record_release(&out[0]);
err = reftable_iterator_next_log(&it, &out[0]);
check(!err);
- check(reftable_log_record_equal(&out[0], &r3[0], GIT_SHA1_RAWSZ));
+ check(reftable_log_record_equal(&out[0], &r3[0], REFTABLE_HASH_SIZE_SHA1));
reftable_iterator_destroy(&it);
for (i = 0; i < len; i++)
@@ -448,11 +520,11 @@ static void t_default_write_opts(void)
check(!err);
hash_id = reftable_reader_hash_id(rd);
- check_int(hash_id, ==, GIT_SHA1_FORMAT_ID);
+ check_int(hash_id, ==, REFTABLE_HASH_SHA1);
- err = reftable_merged_table_new(&merged, &rd, 1, GIT_SHA256_FORMAT_ID);
+ err = reftable_merged_table_new(&merged, &rd, 1, REFTABLE_HASH_SHA256);
check_int(err, ==, REFTABLE_FORMAT_ERROR);
- err = reftable_merged_table_new(&merged, &rd, 1, GIT_SHA1_FORMAT_ID);
+ err = reftable_merged_table_new(&merged, &rd, 1, REFTABLE_HASH_SHA1);
check(!err);
reftable_reader_decref(rd);
@@ -467,6 +539,7 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
TEST(t_merged_logs(), "merged table with multiple log updates for same ref");
TEST(t_merged_refs(), "merged table with multiple updates to same ref");
TEST(t_merged_seek_multiple_times(), "merged table can seek multiple times");
+ TEST(t_merged_seek_multiple_times_without_draining(), "merged table can seek multiple times without draining");
TEST(t_merged_single_record(), "ref occurring in only one record can be fetched");
return test_done();
diff --git a/t/unit-tests/t-reftable-pq.c b/t/unit-tests/t-reftable-pq.c
index ada4c19f18..f3f8a0cdf3 100644
--- a/t/unit-tests/t-reftable-pq.c
+++ b/t/unit-tests/t-reftable-pq.c
@@ -9,6 +9,7 @@ https://developers.google.com/open-source/licenses/bsd
#include "test-lib.h"
#include "reftable/constants.h"
#include "reftable/pq.h"
+#include "strbuf.h"
static void merged_iter_pqueue_check(const struct merged_iter_pqueue *pq)
{
@@ -132,7 +133,7 @@ static void t_merged_iter_pqueue_top(void)
merged_iter_pqueue_check(&pq);
check(pq_entry_equal(&top, &e));
- check(reftable_record_equal(top.rec, &recs[i], GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(top.rec, &recs[i], REFTABLE_HASH_SIZE_SHA1));
for (size_t j = 0; i < pq.len; j++) {
check(pq_less(&top, &pq.heap[j]));
check_int(top.index, >, j);
diff --git a/t/unit-tests/t-reftable-reader.c b/t/unit-tests/t-reftable-reader.c
index 19cb53b641..546df6005e 100644
--- a/t/unit-tests/t-reftable-reader.c
+++ b/t/unit-tests/t-reftable-reader.c
@@ -31,7 +31,7 @@ static int t_reader_seek_once(void)
ret = reftable_iterator_next_ref(&it, &ref);
check(!ret);
- ret = reftable_ref_record_equal(&ref, &records[0], GIT_SHA1_RAWSZ);
+ ret = reftable_ref_record_equal(&ref, &records[0], REFTABLE_HASH_SIZE_SHA1);
check_int(ret, ==, 1);
ret = reftable_iterator_next_ref(&it, &ref);
@@ -74,7 +74,7 @@ static int t_reader_reseek(void)
ret = reftable_iterator_next_ref(&it, &ref);
check(!ret);
- ret = reftable_ref_record_equal(&ref, &records[0], GIT_SHA1_RAWSZ);
+ ret = reftable_ref_record_equal(&ref, &records[0], REFTABLE_HASH_SIZE_SHA1);
check_int(ret, ==, 1);
ret = reftable_iterator_next_ref(&it, &ref);
diff --git a/t/unit-tests/t-reftable-readwrite.c b/t/unit-tests/t-reftable-readwrite.c
index 7ffbd78c67..c9626831da 100644
--- a/t/unit-tests/t-reftable-readwrite.c
+++ b/t/unit-tests/t-reftable-readwrite.c
@@ -6,6 +6,8 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-lib.h"
#include "lib-reftable.h"
#include "reftable/basics.h"
@@ -13,6 +15,7 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable/reader.h"
#include "reftable/reftable-error.h"
#include "reftable/reftable-writer.h"
+#include "strbuf.h"
static const int update_index = 5;
@@ -41,7 +44,7 @@ static void t_buffer(void)
}
static void write_table(char ***names, struct reftable_buf *buf, int N,
- int block_size, uint32_t hash_id)
+ int block_size, enum reftable_hash hash_id)
{
struct reftable_write_options opts = {
.block_size = block_size,
@@ -62,7 +65,7 @@ static void write_table(char ***names, struct reftable_buf *buf, int N,
refs[i].refname = (*names)[i] = xstrfmt("refs/heads/branch%02d", i);
refs[i].update_index = update_index;
refs[i].value_type = REFTABLE_REF_VAL1;
- t_reftable_set_hash(refs[i].value.val1, i, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(refs[i].value.val1, i, REFTABLE_HASH_SHA1);
}
for (i = 0; i < N; i++) {
@@ -70,7 +73,7 @@ static void write_table(char ***names, struct reftable_buf *buf, int N,
logs[i].update_index = update_index;
logs[i].value_type = REFTABLE_LOG_UPDATE;
t_reftable_set_hash(logs[i].value.update.new_hash, i,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
logs[i].value.update.message = (char *) "message";
}
@@ -104,9 +107,9 @@ static void t_log_buffer_size(void)
/* This tests buffer extension for log compression. Must use a random
hash, to ensure that the compressed part is larger than the original.
*/
- for (i = 0; i < GIT_SHA1_RAWSZ; i++) {
- log.value.update.old_hash[i] = (uint8_t)(git_rand() % 256);
- log.value.update.new_hash[i] = (uint8_t)(git_rand() % 256);
+ for (i = 0; i < REFTABLE_HASH_SIZE_SHA1; i++) {
+ log.value.update.old_hash[i] = (uint8_t)(git_rand(0) % 256);
+ log.value.update.new_hash[i] = (uint8_t)(git_rand(0) % 256);
}
reftable_writer_set_limits(w, update_index, update_index);
err = reftable_writer_add_log(w, &log);
@@ -233,9 +236,9 @@ static void t_log_write_read(void)
log.update_index = i;
log.value_type = REFTABLE_LOG_UPDATE;
t_reftable_set_hash(log.value.update.old_hash, i,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
t_reftable_set_hash(log.value.update.new_hash, i + 1,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
err = reftable_writer_add_log(w, &log);
check(!err);
@@ -322,7 +325,7 @@ static void t_log_zlib_corruption(void)
};
for (i = 0; i < sizeof(message) - 1; i++)
- message[i] = (uint8_t)(git_rand() % 64 + ' ');
+ message[i] = (uint8_t)(git_rand(0) % 64 + ' ');
reftable_writer_set_limits(w, 1, 1);
@@ -368,7 +371,7 @@ static void t_table_read_write_sequential(void)
int err = 0;
int j = 0;
- write_table(&names, &buf, N, 256, GIT_SHA1_FORMAT_ID);
+ write_table(&names, &buf, N, 256, REFTABLE_HASH_SHA1);
block_source_from_buf(&source, &buf);
@@ -403,7 +406,7 @@ static void t_table_write_small_table(void)
char **names;
struct reftable_buf buf = REFTABLE_BUF_INIT;
int N = 1;
- write_table(&names, &buf, N, 4096, GIT_SHA1_FORMAT_ID);
+ write_table(&names, &buf, N, 4096, REFTABLE_HASH_SHA1);
check_int(buf.len, <, 200);
reftable_buf_release(&buf);
free_names(names);
@@ -420,7 +423,7 @@ static void t_table_read_api(void)
struct reftable_log_record log = { 0 };
struct reftable_iterator it = { 0 };
- write_table(&names, &buf, N, 256, GIT_SHA1_FORMAT_ID);
+ write_table(&names, &buf, N, 256, REFTABLE_HASH_SHA1);
block_source_from_buf(&source, &buf);
@@ -442,7 +445,7 @@ static void t_table_read_api(void)
reftable_buf_release(&buf);
}
-static void t_table_read_write_seek(int index, int hash_id)
+static void t_table_read_write_seek(int index, enum reftable_hash hash_id)
{
char **names;
struct reftable_buf buf = REFTABLE_BUF_INIT;
@@ -509,24 +512,24 @@ static void t_table_read_write_seek(int index, int hash_id)
static void t_table_read_write_seek_linear(void)
{
- t_table_read_write_seek(0, GIT_SHA1_FORMAT_ID);
+ t_table_read_write_seek(0, REFTABLE_HASH_SHA1);
}
static void t_table_read_write_seek_linear_sha256(void)
{
- t_table_read_write_seek(0, GIT_SHA256_FORMAT_ID);
+ t_table_read_write_seek(0, REFTABLE_HASH_SHA256);
}
static void t_table_read_write_seek_index(void)
{
- t_table_read_write_seek(1, GIT_SHA1_FORMAT_ID);
+ t_table_read_write_seek(1, REFTABLE_HASH_SHA1);
}
static void t_table_refs_for(int indexed)
{
char **want_names;
int want_names_len = 0;
- uint8_t want_hash[GIT_SHA1_RAWSZ];
+ uint8_t want_hash[REFTABLE_HASH_SIZE_SHA1];
struct reftable_write_options opts = {
.block_size = 256,
@@ -542,10 +545,10 @@ static void t_table_refs_for(int indexed)
want_names = reftable_calloc(N + 1, sizeof(*want_names));
check(want_names != NULL);
- t_reftable_set_hash(want_hash, 4, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(want_hash, 4, REFTABLE_HASH_SHA1);
for (i = 0; i < N; i++) {
- uint8_t hash[GIT_SHA1_RAWSZ];
+ uint8_t hash[REFTABLE_HASH_SIZE_SHA1];
char fill[51] = { 0 };
char name[100];
struct reftable_ref_record ref = { 0 };
@@ -559,9 +562,9 @@ static void t_table_refs_for(int indexed)
ref.value_type = REFTABLE_REF_VAL2;
t_reftable_set_hash(ref.value.val2.value, i / 4,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
t_reftable_set_hash(ref.value.val2.target_value, 3 + i / 4,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
/* 80 bytes / entry, so 3 entries per block. Yields 17
*/
@@ -569,8 +572,8 @@ static void t_table_refs_for(int indexed)
n = reftable_writer_add_ref(w, &ref);
check_int(n, ==, 0);
- if (!memcmp(ref.value.val2.value, want_hash, GIT_SHA1_RAWSZ) ||
- !memcmp(ref.value.val2.target_value, want_hash, GIT_SHA1_RAWSZ))
+ if (!memcmp(ref.value.val2.value, want_hash, REFTABLE_HASH_SIZE_SHA1) ||
+ !memcmp(ref.value.val2.target_value, want_hash, REFTABLE_HASH_SIZE_SHA1))
want_names[want_names_len++] = xstrdup(name);
}
@@ -640,7 +643,7 @@ static void t_write_empty_table(void)
check_int(err, ==, REFTABLE_EMPTY_TABLE_ERROR);
reftable_writer_free(w);
- check_int(buf.len, ==, header_size(1) + footer_size(1));
+ check_uint(buf.len, ==, header_size(1) + footer_size(1));
block_source_from_buf(&source, &buf);
diff --git a/t/unit-tests/t-reftable-record.c b/t/unit-tests/t-reftable-record.c
index eb98bf2da9..d49d2a2729 100644
--- a/t/unit-tests/t-reftable-record.c
+++ b/t/unit-tests/t-reftable-record.c
@@ -7,6 +7,7 @@
*/
#include "test-lib.h"
+#include "reftable/basics.h"
#include "reftable/constants.h"
#include "reftable/record.h"
@@ -17,10 +18,10 @@ static void t_copy(struct reftable_record *rec)
typ = reftable_record_type(rec);
reftable_record_init(&copy, typ);
- reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);
+ reftable_record_copy_from(&copy, rec, REFTABLE_HASH_SIZE_SHA1);
/* do it twice to catch memory leaks */
- reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);
- check(reftable_record_equal(rec, &copy, GIT_SHA1_RAWSZ));
+ reftable_record_copy_from(&copy, rec, REFTABLE_HASH_SIZE_SHA1);
+ check(reftable_record_equal(rec, &copy, REFTABLE_HASH_SIZE_SHA1));
reftable_record_release(&copy);
}
@@ -57,9 +58,25 @@ static void t_varint_roundtrip(void)
}
}
+static void t_varint_overflow(void)
+{
+ unsigned char buf[] = {
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00,
+ };
+ struct string_view view = {
+ .buf = buf,
+ .len = sizeof(buf),
+ };
+ uint64_t value;
+ int err = get_var_int(&value, &view);
+ check_int(err, ==, -1);
+}
+
static void set_hash(uint8_t *h, int j)
{
- for (int i = 0; i < hash_size(GIT_SHA1_FORMAT_ID); i++)
+ for (size_t i = 0; i < hash_size(REFTABLE_HASH_SHA1); i++)
h[i] = (j >> i) & 0xff;
}
@@ -84,14 +101,14 @@ static void t_reftable_ref_record_comparison(void)
},
};
- check(!reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
- check(!reftable_record_equal(&in[1], &in[2], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
check_int(reftable_record_cmp(&in[1], &in[2]), >, 0);
in[1].u.ref.value_type = in[0].u.ref.value_type;
- check(reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
}
@@ -155,15 +172,15 @@ static void t_reftable_ref_record_roundtrip(void)
check_int(reftable_record_is_deletion(&in), ==, i == REFTABLE_REF_DELETION);
reftable_record_key(&in, &key);
- n = reftable_record_encode(&in, dest, GIT_SHA1_RAWSZ);
+ n = reftable_record_encode(&in, dest, REFTABLE_HASH_SIZE_SHA1);
check_int(n, >, 0);
/* decode into a non-zero reftable_record to test for leaks. */
- m = reftable_record_decode(&out, key, i, dest, GIT_SHA1_RAWSZ, &scratch);
+ m = reftable_record_decode(&out, key, i, dest, REFTABLE_HASH_SIZE_SHA1, &scratch);
check_int(n, ==, m);
check(reftable_ref_record_equal(&in.u.ref, &out.u.ref,
- GIT_SHA1_RAWSZ));
+ REFTABLE_HASH_SIZE_SHA1));
reftable_record_release(&in);
reftable_buf_release(&key);
@@ -193,15 +210,15 @@ static void t_reftable_log_record_comparison(void)
},
};
- check(!reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
- check(!reftable_record_equal(&in[1], &in[2], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
+ check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
check_int(reftable_record_cmp(&in[1], &in[2]), >, 0);
/* comparison should be reversed for equal keys, because
* comparison is now performed on the basis of update indices */
check_int(reftable_record_cmp(&in[0], &in[1]), <, 0);
in[1].u.log.update_index = in[0].u.log.update_index;
- check(reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
}
@@ -303,15 +320,15 @@ static void t_reftable_log_record_roundtrip(void)
reftable_record_key(&rec, &key);
- n = reftable_record_encode(&rec, dest, GIT_SHA1_RAWSZ);
+ n = reftable_record_encode(&rec, dest, REFTABLE_HASH_SIZE_SHA1);
check_int(n, >=, 0);
valtype = reftable_record_val_type(&rec);
m = reftable_record_decode(&out, key, valtype, dest,
- GIT_SHA1_RAWSZ, &scratch);
+ REFTABLE_HASH_SIZE_SHA1, &scratch);
check_int(n, ==, m);
check(reftable_log_record_equal(&in[i], &out.u.log,
- GIT_SHA1_RAWSZ));
+ REFTABLE_HASH_SIZE_SHA1));
reftable_log_record_release(&in[i]);
reftable_buf_release(&key);
reftable_record_release(&out);
@@ -380,20 +397,20 @@ static void t_reftable_obj_record_comparison(void)
},
};
- check(!reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
- check(!reftable_record_equal(&in[1], &in[2], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
check_int(reftable_record_cmp(&in[1], &in[2]), >, 0);
in[1].u.obj.offset_len = in[0].u.obj.offset_len;
- check(reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
}
static void t_reftable_obj_record_roundtrip(void)
{
- uint8_t testHash1[GIT_SHA1_RAWSZ] = { 1, 2, 3, 4, 0 };
+ uint8_t testHash1[REFTABLE_HASH_SIZE_SHA1] = { 1, 2, 3, 4, 0 };
uint64_t till9[] = { 1, 2, 3, 4, 500, 600, 700, 800, 9000 };
struct reftable_obj_record recs[3] = {
{
@@ -435,14 +452,14 @@ static void t_reftable_obj_record_roundtrip(void)
check(!reftable_record_is_deletion(&in));
t_copy(&in);
reftable_record_key(&in, &key);
- n = reftable_record_encode(&in, dest, GIT_SHA1_RAWSZ);
+ n = reftable_record_encode(&in, dest, REFTABLE_HASH_SIZE_SHA1);
check_int(n, >, 0);
extra = reftable_record_val_type(&in);
m = reftable_record_decode(&out, key, extra, dest,
- GIT_SHA1_RAWSZ, &scratch);
+ REFTABLE_HASH_SIZE_SHA1, &scratch);
check_int(n, ==, m);
- check(reftable_record_equal(&in, &out, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&in, &out, REFTABLE_HASH_SIZE_SHA1));
reftable_buf_release(&key);
reftable_record_release(&out);
}
@@ -473,14 +490,14 @@ static void t_reftable_index_record_comparison(void)
check(!reftable_buf_addstr(&in[1].u.idx.last_key, "refs/heads/master"));
check(!reftable_buf_addstr(&in[2].u.idx.last_key, "refs/heads/branch"));
- check(!reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
- check(!reftable_record_equal(&in[1], &in[2], GIT_SHA1_RAWSZ));
+ check(!reftable_record_equal(&in[1], &in[2], REFTABLE_HASH_SIZE_SHA1));
check_int(reftable_record_cmp(&in[1], &in[2]), >, 0);
in[1].u.idx.offset = in[0].u.idx.offset;
- check(reftable_record_equal(&in[0], &in[1], GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&in[0], &in[1], REFTABLE_HASH_SIZE_SHA1));
check(!reftable_record_cmp(&in[0], &in[1]));
for (size_t i = 0; i < ARRAY_SIZE(in); i++)
@@ -516,15 +533,15 @@ static void t_reftable_index_record_roundtrip(void)
check(!reftable_record_is_deletion(&in));
check(!reftable_buf_cmp(&key, &in.u.idx.last_key));
- n = reftable_record_encode(&in, dest, GIT_SHA1_RAWSZ);
+ n = reftable_record_encode(&in, dest, REFTABLE_HASH_SIZE_SHA1);
check_int(n, >, 0);
extra = reftable_record_val_type(&in);
- m = reftable_record_decode(&out, key, extra, dest, GIT_SHA1_RAWSZ,
+ m = reftable_record_decode(&out, key, extra, dest, REFTABLE_HASH_SIZE_SHA1,
&scratch);
check_int(m, ==, n);
- check(reftable_record_equal(&in, &out, GIT_SHA1_RAWSZ));
+ check(reftable_record_equal(&in, &out, REFTABLE_HASH_SIZE_SHA1));
reftable_record_release(&out);
reftable_buf_release(&key);
@@ -543,6 +560,7 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
TEST(t_reftable_log_record_roundtrip(), "record operations work on log record");
TEST(t_reftable_ref_record_roundtrip(), "record operations work on ref record");
TEST(t_varint_roundtrip(), "put_var_int and get_var_int work");
+ TEST(t_varint_overflow(), "get_var_int notices an integer overflow");
TEST(t_key_roundtrip(), "reftable_encode_key and reftable_decode_key work");
TEST(t_reftable_obj_record_roundtrip(), "record operations work on obj record");
TEST(t_reftable_index_record_roundtrip(), "record operations work on index record");
diff --git a/t/unit-tests/t-reftable-stack.c b/t/unit-tests/t-reftable-stack.c
index 52b81475c3..aeec195b2b 100644
--- a/t/unit-tests/t-reftable-stack.c
+++ b/t/unit-tests/t-reftable-stack.c
@@ -6,12 +6,17 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-lib.h"
#include "lib-reftable.h"
+#include "dir.h"
#include "reftable/merged.h"
#include "reftable/reader.h"
#include "reftable/reftable-error.h"
#include "reftable/stack.h"
+#include "strbuf.h"
+#include "tempfile.h"
#include <dirent.h>
static void clear_dir(const char *dirname)
@@ -120,7 +125,7 @@ static void write_n_ref_tables(struct reftable_stack *st,
snprintf(buf, sizeof(buf), "refs/heads/branch-%04"PRIuMAX, (uintmax_t)i);
ref.refname = buf;
- t_reftable_set_hash(ref.value.val1, i, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(ref.value.val1, i, REFTABLE_HASH_SHA1);
err = reftable_stack_add(st, &write_test_ref, &ref);
check(!err);
@@ -168,7 +173,7 @@ static void t_reftable_stack_add_one(void)
err = reftable_stack_read_ref(st, ref.refname, &dest);
check(!err);
- check(reftable_ref_record_equal(&ref, &dest, GIT_SHA1_RAWSZ));
+ check(reftable_ref_record_equal(&ref, &dest, REFTABLE_HASH_SIZE_SHA1));
check_int(st->readers_len, >, 0);
#ifndef GIT_WINDOWS_NATIVE
@@ -279,7 +284,7 @@ static void t_reftable_stack_transaction_api(void)
err = reftable_stack_read_ref(st, ref.refname, &dest);
check(!err);
check_int(REFTABLE_REF_SYMREF, ==, dest.value_type);
- check(reftable_ref_record_equal(&ref, &dest, GIT_SHA1_RAWSZ));
+ check(reftable_ref_record_equal(&ref, &dest, REFTABLE_HASH_SIZE_SHA1));
reftable_ref_record_release(&dest);
reftable_stack_destroy(st);
@@ -339,7 +344,7 @@ static void t_reftable_stack_transaction_with_reload(void)
for (size_t i = 0; i < ARRAY_SIZE(refs); i++) {
err = reftable_stack_read_ref(st2, refs[i].refname, &ref);
check(!err);
- check(reftable_ref_record_equal(&refs[i], &ref, GIT_SHA1_RAWSZ));
+ check(reftable_ref_record_equal(&refs[i], &ref, REFTABLE_HASH_SIZE_SHA1));
}
reftable_ref_record_release(&ref);
@@ -529,13 +534,13 @@ static void t_reftable_stack_add(void)
refs[i].refname = xstrdup(buf);
refs[i].update_index = i + 1;
refs[i].value_type = REFTABLE_REF_VAL1;
- t_reftable_set_hash(refs[i].value.val1, i, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(refs[i].value.val1, i, REFTABLE_HASH_SHA1);
logs[i].refname = xstrdup(buf);
logs[i].update_index = N + i + 1;
logs[i].value_type = REFTABLE_LOG_UPDATE;
logs[i].value.update.email = xstrdup("identity@invalid");
- t_reftable_set_hash(logs[i].value.update.new_hash, i, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(logs[i].value.update.new_hash, i, REFTABLE_HASH_SHA1);
}
for (i = 0; i < N; i++) {
@@ -561,7 +566,7 @@ static void t_reftable_stack_add(void)
int err = reftable_stack_read_ref(st, refs[i].refname, &dest);
check(!err);
check(reftable_ref_record_equal(&dest, refs + i,
- GIT_SHA1_RAWSZ));
+ REFTABLE_HASH_SIZE_SHA1));
reftable_ref_record_release(&dest);
}
@@ -570,7 +575,7 @@ static void t_reftable_stack_add(void)
int err = reftable_stack_read_log(st, refs[i].refname, &dest);
check(!err);
check(reftable_log_record_equal(&dest, logs + i,
- GIT_SHA1_RAWSZ));
+ REFTABLE_HASH_SIZE_SHA1));
reftable_log_record_release(&dest);
}
@@ -621,14 +626,14 @@ static void t_reftable_stack_iterator(void)
refs[i].refname = xstrfmt("branch%02"PRIuMAX, (uintmax_t)i);
refs[i].update_index = i + 1;
refs[i].value_type = REFTABLE_REF_VAL1;
- t_reftable_set_hash(refs[i].value.val1, i, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(refs[i].value.val1, i, REFTABLE_HASH_SHA1);
logs[i].refname = xstrfmt("branch%02"PRIuMAX, (uintmax_t)i);
logs[i].update_index = i + 1;
logs[i].value_type = REFTABLE_LOG_UPDATE;
logs[i].value.update.email = xstrdup("johndoe@invalid");
logs[i].value.update.message = xstrdup("commit\n");
- t_reftable_set_hash(logs[i].value.update.new_hash, i, GIT_SHA1_FORMAT_ID);
+ t_reftable_set_hash(logs[i].value.update.new_hash, i, REFTABLE_HASH_SHA1);
}
for (i = 0; i < N; i++) {
@@ -655,7 +660,7 @@ static void t_reftable_stack_iterator(void)
if (err > 0)
break;
check(!err);
- check(reftable_ref_record_equal(&ref, &refs[i], GIT_SHA1_RAWSZ));
+ check(reftable_ref_record_equal(&ref, &refs[i], REFTABLE_HASH_SIZE_SHA1));
reftable_ref_record_release(&ref);
}
check_int(i, ==, N);
@@ -673,7 +678,7 @@ static void t_reftable_stack_iterator(void)
if (err > 0)
break;
check(!err);
- check(reftable_log_record_equal(&log, &logs[i], GIT_SHA1_RAWSZ));
+ check(reftable_log_record_equal(&log, &logs[i], REFTABLE_HASH_SIZE_SHA1));
reftable_log_record_release(&log);
}
check_int(i, ==, N);
@@ -766,7 +771,7 @@ static void t_reftable_stack_tombstone(void)
if (i % 2 == 0) {
refs[i].value_type = REFTABLE_REF_VAL1;
t_reftable_set_hash(refs[i].value.val1, i,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
}
logs[i].refname = xstrdup(buf);
@@ -779,7 +784,7 @@ static void t_reftable_stack_tombstone(void)
if (i % 2 == 0) {
logs[i].value_type = REFTABLE_LOG_UPDATE;
t_reftable_set_hash(logs[i].value.update.new_hash, i,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
logs[i].value.update.email =
xstrdup("identity@invalid");
}
@@ -839,7 +844,7 @@ static void t_reftable_stack_hash_id(void)
.value.symref = (char *) "target",
.update_index = 1,
};
- struct reftable_write_options opts32 = { .hash_id = GIT_SHA256_FORMAT_ID };
+ struct reftable_write_options opts32 = { .hash_id = REFTABLE_HASH_SHA256 };
struct reftable_stack *st32 = NULL;
struct reftable_write_options opts_default = { 0 };
struct reftable_stack *st_default = NULL;
@@ -862,7 +867,7 @@ static void t_reftable_stack_hash_id(void)
err = reftable_stack_read_ref(st_default, "master", &dest);
check(!err);
- check(reftable_ref_record_equal(&ref, &dest, GIT_SHA1_RAWSZ));
+ check(reftable_ref_record_equal(&ref, &dest, REFTABLE_HASH_SIZE_SHA1));
reftable_ref_record_release(&dest);
reftable_stack_destroy(st);
reftable_stack_destroy(st_default);
@@ -912,7 +917,7 @@ static void t_reflog_expire(void)
logs[i].value.update.time = i;
logs[i].value.update.email = xstrdup("identity@invalid");
t_reftable_set_hash(logs[i].value.update.new_hash, i,
- GIT_SHA1_FORMAT_ID);
+ REFTABLE_HASH_SHA1);
}
for (i = 1; i <= N; i++) {
diff --git a/t/unit-tests/t-trailer.c b/t/unit-tests/t-trailer.c
index e1c6ad7461..184593e73d 100644
--- a/t/unit-tests/t-trailer.c
+++ b/t/unit-tests/t-trailer.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-lib.h"
#include "trailer.h"
diff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c
index fa1f95965c..87e1f5c201 100644
--- a/t/unit-tests/test-lib.c
+++ b/t/unit-tests/test-lib.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "test-lib.h"
enum result {
diff --git a/t/unit-tests/ctype.c b/t/unit-tests/u-ctype.c
index 32e65867cd..32e65867cd 100644
--- a/t/unit-tests/ctype.c
+++ b/t/unit-tests/u-ctype.c
diff --git a/t/unit-tests/t-hash.c b/t/unit-tests/u-hash.c
index e62647019b..a0320efe4b 100644
--- a/t/unit-tests/t-hash.c
+++ b/t/unit-tests/u-hash.c
@@ -1,14 +1,11 @@
-#include "test-lib.h"
+#include "unit-test.h"
#include "hex.h"
#include "strbuf.h"
static void check_hash_data(const void *data, size_t data_length,
const char *expected_hashes[])
{
- if (!check(data != NULL)) {
- test_msg("BUG: NULL data pointer provided");
- return;
- }
+ cl_assert(data != NULL);
for (size_t i = 1; i < ARRAY_SIZE(hash_algos); i++) {
git_hash_ctx ctx;
@@ -19,66 +16,94 @@ static void check_hash_data(const void *data, size_t data_length,
algop->update_fn(&ctx, data, data_length);
algop->final_fn(hash, &ctx);
- if (!check_str(hash_to_hex_algop(hash, algop), expected_hashes[i - 1]))
- test_msg("result does not match with the expected for %s\n", hash_algos[i].name);
+ cl_assert_equal_s(hash_to_hex_algop(hash,algop), expected_hashes[i - 1]);
}
}
/* Works with a NUL terminated string. Doesn't work if it should contain a NUL character. */
#define TEST_HASH_STR(data, expected_sha1, expected_sha256) do { \
const char *expected_hashes[] = { expected_sha1, expected_sha256 }; \
- TEST(check_hash_data(data, strlen(data), expected_hashes), \
- "SHA1 and SHA256 (%s) works", #data); \
+ check_hash_data(data, strlen(data), expected_hashes); \
} while (0)
/* Only works with a literal string, useful when it contains a NUL character. */
#define TEST_HASH_LITERAL(literal, expected_sha1, expected_sha256) do { \
const char *expected_hashes[] = { expected_sha1, expected_sha256 }; \
- TEST(check_hash_data(literal, (sizeof(literal) - 1), expected_hashes), \
- "SHA1 and SHA256 (%s) works", #literal); \
+ check_hash_data(literal, (sizeof(literal) - 1), expected_hashes); \
} while (0)
-int cmd_main(int argc UNUSED, const char **argv UNUSED)
+void test_hash__empty_string(void)
{
- struct strbuf aaaaaaaaaa_100000 = STRBUF_INIT;
- struct strbuf alphabet_100000 = STRBUF_INIT;
-
- strbuf_addstrings(&aaaaaaaaaa_100000, "aaaaaaaaaa", 100000);
- strbuf_addstrings(&alphabet_100000, "abcdefghijklmnopqrstuvwxyz", 100000);
-
TEST_HASH_STR("",
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
+}
+
+void test_hash__single_character(void)
+{
TEST_HASH_STR("a",
"86f7e437faa5a7fce15d1ddcb9eaeaea377667b8",
"ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb");
+}
+
+void test_hash__multi_character(void)
+{
TEST_HASH_STR("abc",
"a9993e364706816aba3e25717850c26c9cd0d89d",
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");
+}
+
+void test_hash__message_digest(void)
+{
TEST_HASH_STR("message digest",
"c12252ceda8be8994d5fa0290a47231c1d16aae3",
"f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650");
+}
+
+void test_hash__alphabet(void)
+{
TEST_HASH_STR("abcdefghijklmnopqrstuvwxyz",
"32d10c7b8cf96570ca04ce37f2a19d84240d3a89",
"71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73");
+}
+
+void test_hash__aaaaaaaaaa_100000(void)
+{
+ struct strbuf aaaaaaaaaa_100000 = STRBUF_INIT;
+ strbuf_addstrings(&aaaaaaaaaa_100000, "aaaaaaaaaa", 100000);
TEST_HASH_STR(aaaaaaaaaa_100000.buf,
"34aa973cd4c4daa4f61eeb2bdbad27316534016f",
"cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0");
+ strbuf_release(&aaaaaaaaaa_100000);
+}
+
+void test_hash__alphabet_100000(void)
+{
+ struct strbuf alphabet_100000 = STRBUF_INIT;
+ strbuf_addstrings(&alphabet_100000, "abcdefghijklmnopqrstuvwxyz", 100000);
TEST_HASH_STR(alphabet_100000.buf,
"e7da7c55b3484fdf52aebec9cbe7b85a98f02fd4",
"e406ba321ca712ad35a698bf0af8d61fc4dc40eca6bdcea4697962724ccbde35");
+ strbuf_release(&alphabet_100000);
+}
+
+void test_hash__zero_blob_literal(void)
+{
TEST_HASH_LITERAL("blob 0\0",
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
"473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813");
+}
+
+void test_hash__three_blob_literal(void)
+{
TEST_HASH_LITERAL("blob 3\0abc",
"f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f",
"c1cf6e465077930e88dc5136641d402f72a229ddd996f627d60e9639eaba35a6");
+}
+
+void test_hash__zero_tree_literal(void)
+{
TEST_HASH_LITERAL("tree 0\0",
"4b825dc642cb6eb9a060e54bf8d69288fbee4904",
"6ef19b41225c5369f1c104d45d8d85efa9b057b53b14b4b9b939dd74decc5321");
-
- strbuf_release(&aaaaaaaaaa_100000);
- strbuf_release(&alphabet_100000);
-
- return test_done();
}
diff --git a/t/unit-tests/u-mem-pool.c b/t/unit-tests/u-mem-pool.c
new file mode 100644
index 0000000000..2bc2493b7e
--- /dev/null
+++ b/t/unit-tests/u-mem-pool.c
@@ -0,0 +1,25 @@
+#include "unit-test.h"
+#include "mem-pool.h"
+
+static void test_many_pool_allocations(size_t block_alloc)
+{
+ struct mem_pool pool = { .block_alloc = block_alloc };
+ size_t size = 100;
+ char *buffer = mem_pool_calloc(&pool, 1, size);
+ for (size_t i = 0; i < size; i++)
+ cl_assert_equal_i(0, buffer[i]);
+ cl_assert(pool.mp_block != NULL);
+ cl_assert(pool.mp_block->next_free != NULL);
+ cl_assert(pool.mp_block->end != NULL);
+ mem_pool_discard(&pool, 0);
+}
+
+void test_mem_pool__big_block(void)
+{
+ test_many_pool_allocations(1024 * 1024);
+}
+
+void test_mem_pool__tiny_block(void)
+{
+ test_many_pool_allocations(1);
+}
diff --git a/t/unit-tests/u-prio-queue.c b/t/unit-tests/u-prio-queue.c
new file mode 100644
index 0000000000..145e689c9c
--- /dev/null
+++ b/t/unit-tests/u-prio-queue.c
@@ -0,0 +1,94 @@
+#include "unit-test.h"
+#include "prio-queue.h"
+
+static int intcmp(const void *va, const void *vb, void *data UNUSED)
+{
+ const int *a = va, *b = vb;
+ return *a - *b;
+}
+
+
+#define MISSING -1
+#define DUMP -2
+#define STACK -3
+#define GET -4
+#define REVERSE -5
+
+static int show(int *v)
+{
+ return v ? *v : MISSING;
+}
+
+static void test_prio_queue(int *input, size_t input_size,
+ int *result, size_t result_size)
+{
+ struct prio_queue pq = { intcmp };
+ size_t j = 0;
+
+ for (size_t i = 0; i < input_size; i++) {
+ void *peek, *get;
+ switch(input[i]) {
+ case GET:
+ peek = prio_queue_peek(&pq);
+ get = prio_queue_get(&pq);
+ cl_assert(peek == get);
+ cl_assert(j < result_size);
+ cl_assert_equal_i(result[j], show(get));
+ j++;
+ break;
+ case DUMP:
+ while ((peek = prio_queue_peek(&pq))) {
+ get = prio_queue_get(&pq);
+ cl_assert(peek == get);
+ cl_assert(j < result_size);
+ cl_assert_equal_i(result[j], show(get));
+ j++;
+ }
+ break;
+ case STACK:
+ pq.compare = NULL;
+ break;
+ case REVERSE:
+ prio_queue_reverse(&pq);
+ break;
+ default:
+ prio_queue_put(&pq, &input[i]);
+ break;
+ }
+ }
+ cl_assert_equal_i(j, result_size);
+ clear_prio_queue(&pq);
+}
+
+#define TEST_INPUT(input, result) \
+ test_prio_queue(input, ARRAY_SIZE(input), result, ARRAY_SIZE(result))
+
+void test_prio_queue__basic(void)
+{
+ TEST_INPUT(((int []){ 2, 6, 3, 10, 9, 5, 7, 4, 5, 8, 1, DUMP }),
+ ((int []){ 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10 }));
+}
+
+void test_prio_queue__mixed(void)
+{
+ TEST_INPUT(((int []){ 6, 2, 4, GET, 5, 3, GET, GET, 1, DUMP }),
+ ((int []){ 2, 3, 4, 1, 5, 6 }));
+}
+
+void test_prio_queue__empty(void)
+{
+ TEST_INPUT(((int []){ 1, 2, GET, GET, GET, 1, 2, GET, GET, GET }),
+ ((int []){ 1, 2, MISSING, 1, 2, MISSING }));
+}
+
+void test_prio_queue__stack(void)
+{
+ TEST_INPUT(((int []){ STACK, 8, 1, 5, 4, 6, 2, 3, DUMP }),
+ ((int []){ 3, 2, 6, 4, 5, 1, 8 }));
+}
+
+void test_prio_queue__reverse_stack(void)
+{
+ TEST_INPUT(((int []){ STACK, 1, 2, 3, 4, 5, 6, REVERSE, DUMP }),
+ ((int []){ 1, 2, 3, 4, 5, 6 }));
+}
diff --git a/t/unit-tests/t-reftable-tree.c b/t/unit-tests/u-reftable-tree.c
index 79b175a45a..bcf9061071 100644
--- a/t/unit-tests/t-reftable-tree.c
+++ b/t/unit-tests/u-reftable-tree.c
@@ -6,7 +6,7 @@ license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/
-#include "test-lib.h"
+#include "unit-test.h"
#include "reftable/tree.h"
static int t_compare(const void *a, const void *b)
@@ -25,7 +25,7 @@ static void store(void *arg, void *key)
c->arr[c->len++] = key;
}
-static void t_tree_search(void)
+void test_reftable_tree__tree_search(void)
{
struct tree_node *root = NULL;
void *values[11] = { 0 };
@@ -38,20 +38,20 @@ static void t_tree_search(void)
*/
do {
nodes[i] = tree_insert(&root, &values[i], &t_compare);
- check(nodes[i] != NULL);
+ cl_assert(nodes[i] != NULL);
i = (i * 7) % 11;
} while (i != 1);
for (i = 1; i < ARRAY_SIZE(nodes); i++) {
- check_pointer_eq(&values[i], nodes[i]->key);
- check_pointer_eq(nodes[i], tree_search(root, &values[i], &t_compare));
+ cl_assert_equal_p(&values[i], nodes[i]->key);
+ cl_assert_equal_p(nodes[i], tree_search(root, &values[i], &t_compare));
}
- check(!tree_search(root, values, t_compare));
+ cl_assert(tree_search(root, values, t_compare) == NULL);
tree_free(root);
}
-static void t_infix_walk(void)
+void test_reftable_tree__infix_walk(void)
{
struct tree_node *root = NULL;
void *values[11] = { 0 };
@@ -64,23 +64,15 @@ static void t_infix_walk(void)
do {
struct tree_node *node = tree_insert(&root, &values[i], t_compare);
- check(node != NULL);
+ cl_assert(node != NULL);
i = (i * 7) % 11;
count++;
} while (i != 1);
infix_walk(root, &store, &c);
for (i = 1; i < ARRAY_SIZE(values); i++)
- check_pointer_eq(&values[i], out[i - 1]);
- check(!out[i - 1]);
- check_int(c.len, ==, count);
+ cl_assert_equal_p(&values[i], out[i - 1]);
+ cl_assert(out[i - 1] == NULL);
+ cl_assert_equal_i(c.len, count);
tree_free(root);
}
-
-int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
-{
- TEST(t_tree_search(), "tree_search works");
- TEST(t_infix_walk(), "infix_walk works");
-
- return test_done();
-}
diff --git a/t/unit-tests/strvec.c b/t/unit-tests/u-strvec.c
index 855b602337..e66b7bbfae 100644
--- a/t/unit-tests/strvec.c
+++ b/t/unit-tests/u-strvec.c
@@ -88,6 +88,16 @@ void test_strvec__pushv(void)
strvec_clear(&vec);
}
+void test_strvec__splice_just_initialized_strvec(void)
+{
+ struct strvec vec = STRVEC_INIT;
+ const char *replacement[] = { "foo" };
+
+ strvec_splice(&vec, 0, 0, replacement, ARRAY_SIZE(replacement));
+ check_strvec(&vec, "foo", NULL);
+ strvec_clear(&vec);
+}
+
void test_strvec__splice_with_same_size_replacement(void)
{
struct strvec vec = STRVEC_INIT;
diff --git a/t/unit-tests/unit-test.c b/t/unit-tests/unit-test.c
index a474cdcfd3..fa8818842a 100644
--- a/t/unit-tests/unit-test.c
+++ b/t/unit-tests/unit-test.c
@@ -18,8 +18,25 @@ int cmd_main(int argc, const char **argv)
N_("immediately exit upon the first failed test")),
OPT_STRING_LIST('r', "run", &run_args, N_("suite[::test]"),
N_("run only test suite or individual test <suite[::test]>")),
- OPT_STRING_LIST('x', "exclude", &exclude_args, N_("suite"),
+ OPT_STRING_LIST(0, "exclude", &exclude_args, N_("suite"),
N_("exclude test suite <suite>")),
+ /*
+ * Compatibility wrappers so that we don't have to filter
+ * options understood by integration tests.
+ */
+ OPT_NOOP_NOARG('d', "debug"),
+ OPT_NOOP_NOARG(0, "github-workflow-markup"),
+ OPT_NOOP_NOARG(0, "no-bin-wrappers"),
+ OPT_NOOP_ARG(0, "root"),
+ OPT_NOOP_ARG(0, "stress"),
+ OPT_NOOP_NOARG(0, "tee"),
+ OPT_NOOP_NOARG(0, "with-dashes"),
+ OPT_NOOP_ARG(0, "valgrind"),
+ OPT_NOOP_ARG(0, "valgrind-only"),
+ OPT_NOOP_NOARG('v', "verbose"),
+ OPT_NOOP_NOARG('V', "verbose-log"),
+ OPT_NOOP_ARG(0, "verbose-only"),
+ OPT_NOOP_NOARG('x', NULL),
OPT_END(),
};
struct strvec args = STRVEC_INIT;
diff --git a/tag.c b/tag.c
index d24170e340..8d9e9e2930 100644
--- a/tag.c
+++ b/tag.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "environment.h"
@@ -84,7 +85,7 @@ struct object *deref_tag(struct repository *r, struct object *o, const char *war
o = NULL;
}
if (!o && warn) {
- if (last_oid && is_promisor_object(last_oid))
+ if (last_oid && is_promisor_object(r, last_oid))
return NULL;
if (!warnlen)
warnlen = strlen(warn);
diff --git a/templates/Makefile b/templates/Makefile
index 367ad00c24..bd1e9e30c1 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -29,24 +29,35 @@ all: boilerplates.made custom
# in a file direc--tory--file in the source. They will be
# just copied to the destination.
-bpsrc = $(filter-out %~,$(wildcard *--*))
-boilerplates.made : $(bpsrc)
- $(QUIET)umask 022 && ls *--* 2>/dev/null | \
- while read boilerplate; \
+TEMPLATES =
+TEMPLATES += description
+TEMPLATES += hooks/applypatch-msg.sample
+TEMPLATES += hooks/commit-msg.sample
+TEMPLATES += hooks/fsmonitor-watchman.sample
+TEMPLATES += hooks/post-update.sample
+TEMPLATES += hooks/pre-applypatch.sample
+TEMPLATES += hooks/pre-commit.sample
+TEMPLATES += hooks/pre-merge-commit.sample
+TEMPLATES += hooks/prepare-commit-msg.sample
+TEMPLATES += hooks/pre-push.sample
+TEMPLATES += hooks/pre-rebase.sample
+TEMPLATES += hooks/pre-receive.sample
+TEMPLATES += hooks/push-to-checkout.sample
+TEMPLATES += hooks/sendemail-validate.sample
+TEMPLATES += hooks/update.sample
+TEMPLATES += info/exclude
+
+boilerplates.made: $(TEMPLATES)
+ $(QUIET)umask 022 && for template in $(TEMPLATES); \
do \
- case "$$boilerplate" in *~) continue ;; esac && \
- dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
- dir=`expr "$$dst" : '\(.*\)/'` && \
+ dir=$$(dirname "$$template") && \
mkdir -p blt/$$dir && \
- case "$$boilerplate" in \
- *--) continue;; \
- esac && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
- -e 's|@PERL_PATH@|$(PERL_PATH_SQ)|g' $$boilerplate > \
- blt/$$dst && \
- if test -x "$$boilerplate"; then rx=rx; else rx=r; fi && \
- chmod a+$$rx "blt/$$dst" || exit; \
+ -e 's|@PERL_PATH@|$(PERL_PATH_SQ)|g' $$template > \
+ blt/$$template && \
+ if test -x "$$template"; then rx=rx; else rx=r; fi && \
+ chmod a+$$rx "blt/$$template" || exit; \
done && \
date >$@
diff --git a/templates/branches-- b/templates/branches--
deleted file mode 100644
index fae88709a6..0000000000
--- a/templates/branches--
+++ /dev/null
@@ -1 +0,0 @@
-: this is just to ensure the directory exists.
diff --git a/templates/this--description b/templates/description
index 498b267a8c..498b267a8c 100644
--- a/templates/this--description
+++ b/templates/description
diff --git a/templates/hooks--applypatch-msg.sample b/templates/hooks/applypatch-msg.sample
index a5d7b84a67..a5d7b84a67 100755
--- a/templates/hooks--applypatch-msg.sample
+++ b/templates/hooks/applypatch-msg.sample
diff --git a/templates/hooks--commit-msg.sample b/templates/hooks/commit-msg.sample
index b58d1184a9..b58d1184a9 100755
--- a/templates/hooks--commit-msg.sample
+++ b/templates/hooks/commit-msg.sample
diff --git a/templates/hooks--fsmonitor-watchman.sample b/templates/hooks/fsmonitor-watchman.sample
index 23e856f5de..23e856f5de 100755
--- a/templates/hooks--fsmonitor-watchman.sample
+++ b/templates/hooks/fsmonitor-watchman.sample
diff --git a/templates/hooks/meson.build b/templates/hooks/meson.build
new file mode 100644
index 0000000000..ef85e10a16
--- /dev/null
+++ b/templates/hooks/meson.build
@@ -0,0 +1,26 @@
+hooks = [
+ 'applypatch-msg.sample',
+ 'commit-msg.sample',
+ 'fsmonitor-watchman.sample',
+ 'post-update.sample',
+ 'pre-applypatch.sample',
+ 'pre-commit.sample',
+ 'pre-merge-commit.sample',
+ 'prepare-commit-msg.sample',
+ 'pre-push.sample',
+ 'pre-rebase.sample',
+ 'pre-receive.sample',
+ 'push-to-checkout.sample',
+ 'sendemail-validate.sample',
+ 'update.sample',
+]
+
+foreach hook : hooks
+ configure_file(
+ input: hook,
+ output: hook,
+ configuration: template_config,
+ install: true,
+ install_dir: get_option('datadir') / 'git-core/templates/hooks',
+ )
+endforeach
diff --git a/templates/hooks--post-update.sample b/templates/hooks/post-update.sample
index ec17ec1939..ec17ec1939 100755
--- a/templates/hooks--post-update.sample
+++ b/templates/hooks/post-update.sample
diff --git a/templates/hooks--pre-applypatch.sample b/templates/hooks/pre-applypatch.sample
index 4142082bcb..4142082bcb 100755
--- a/templates/hooks--pre-applypatch.sample
+++ b/templates/hooks/pre-applypatch.sample
diff --git a/templates/hooks--pre-commit.sample b/templates/hooks/pre-commit.sample
index 29ed5ee486..29ed5ee486 100755
--- a/templates/hooks--pre-commit.sample
+++ b/templates/hooks/pre-commit.sample
diff --git a/templates/hooks--pre-merge-commit.sample b/templates/hooks/pre-merge-commit.sample
index 399eab1924..399eab1924 100755
--- a/templates/hooks--pre-merge-commit.sample
+++ b/templates/hooks/pre-merge-commit.sample
diff --git a/templates/hooks--pre-push.sample b/templates/hooks/pre-push.sample
index 4ce688d32b..4ce688d32b 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks/pre-push.sample
diff --git a/templates/hooks--pre-rebase.sample b/templates/hooks/pre-rebase.sample
index db5feab8a1..db5feab8a1 100755
--- a/templates/hooks--pre-rebase.sample
+++ b/templates/hooks/pre-rebase.sample
diff --git a/templates/hooks--pre-receive.sample b/templates/hooks/pre-receive.sample
index a1fd29ec14..a1fd29ec14 100755
--- a/templates/hooks--pre-receive.sample
+++ b/templates/hooks/pre-receive.sample
diff --git a/templates/hooks--prepare-commit-msg.sample b/templates/hooks/prepare-commit-msg.sample
index 318afe3fd8..318afe3fd8 100755
--- a/templates/hooks--prepare-commit-msg.sample
+++ b/templates/hooks/prepare-commit-msg.sample
diff --git a/templates/hooks--push-to-checkout.sample b/templates/hooks/push-to-checkout.sample
index af5a0c0018..af5a0c0018 100755
--- a/templates/hooks--push-to-checkout.sample
+++ b/templates/hooks/push-to-checkout.sample
diff --git a/templates/hooks--sendemail-validate.sample b/templates/hooks/sendemail-validate.sample
index 640bcf874d..640bcf874d 100755
--- a/templates/hooks--sendemail-validate.sample
+++ b/templates/hooks/sendemail-validate.sample
diff --git a/templates/hooks--update.sample b/templates/hooks/update.sample
index c4d426bc6e..c4d426bc6e 100755
--- a/templates/hooks--update.sample
+++ b/templates/hooks/update.sample
diff --git a/templates/info--exclude b/templates/info/exclude
index a5196d1be8..a5196d1be8 100644
--- a/templates/info--exclude
+++ b/templates/info/exclude
diff --git a/templates/info/meson.build b/templates/info/meson.build
new file mode 100644
index 0000000000..026f231385
--- /dev/null
+++ b/templates/info/meson.build
@@ -0,0 +1,7 @@
+configure_file(
+ input: 'exclude',
+ output: 'exclude',
+ configuration: template_config,
+ install: true,
+ install_dir: get_option('datadir') / 'git-core/templates/info',
+)
diff --git a/templates/meson.build b/templates/meson.build
new file mode 100644
index 0000000000..1faf9a44ce
--- /dev/null
+++ b/templates/meson.build
@@ -0,0 +1,15 @@
+template_config = configuration_data()
+template_config.set('PERL_PATH', perl.found() ? fs.as_posix(perl.full_path()) : '')
+template_config.set('SHELL_PATH', fs.as_posix(shell.full_path()))
+template_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
+
+configure_file(
+ input: 'description',
+ output: 'description',
+ configuration: template_config,
+ install: true,
+ install_dir: get_option('datadir') / 'git-core/templates',
+)
+
+subdir('hooks')
+subdir('info')
diff --git a/tmp-objdir.c b/tmp-objdir.c
index 9da0071cba..0ea078a5c5 100644
--- a/tmp-objdir.c
+++ b/tmp-objdir.c
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "git-compat-util.h"
#include "tmp-objdir.h"
#include "abspath.h"
@@ -16,6 +14,7 @@
#include "repository.h"
struct tmp_objdir {
+ struct repository *repo;
struct strbuf path;
struct strvec env;
struct object_directory *prev_odb;
@@ -116,7 +115,8 @@ static int setup_tmp_objdir(const char *root)
return ret;
}
-struct tmp_objdir *tmp_objdir_create(const char *prefix)
+struct tmp_objdir *tmp_objdir_create(struct repository *r,
+ const char *prefix)
{
static int installed_handlers;
struct tmp_objdir *t;
@@ -125,6 +125,7 @@ struct tmp_objdir *tmp_objdir_create(const char *prefix)
BUG("only one tmp_objdir can be used at a time");
t = xcalloc(1, sizeof(*t));
+ t->repo = r;
strbuf_init(&t->path, 0);
strvec_init(&t->env);
@@ -134,7 +135,7 @@ struct tmp_objdir *tmp_objdir_create(const char *prefix)
* them.
*/
strbuf_addf(&t->path, "%s/tmp_objdir-%s-XXXXXX",
- repo_get_object_directory(the_repository), prefix);
+ repo_get_object_directory(r), prefix);
if (!mkdtemp(t->path.buf)) {
/* free, not destroy, as we never touched the filesystem */
@@ -154,7 +155,7 @@ struct tmp_objdir *tmp_objdir_create(const char *prefix)
}
env_append(&t->env, ALTERNATE_DB_ENVIRONMENT,
- absolute_path(repo_get_object_directory(the_repository)));
+ absolute_path(repo_get_object_directory(r)));
env_replace(&t->env, DB_ENVIRONMENT, absolute_path(t->path.buf));
env_replace(&t->env, GIT_QUARANTINE_ENVIRONMENT,
absolute_path(t->path.buf));
@@ -237,7 +238,6 @@ static int migrate_paths(struct strbuf *src, struct strbuf *dst,
{
size_t src_len = src->len, dst_len = dst->len;
struct string_list paths = STRING_LIST_INIT_DUP;
- int i;
int ret = 0;
if (read_dir_paths(&paths, src->buf) < 0)
@@ -245,7 +245,7 @@ static int migrate_paths(struct strbuf *src, struct strbuf *dst,
paths.cmp = pack_copy_cmp;
string_list_sort(&paths);
- for (i = 0; i < paths.nr; i++) {
+ for (size_t i = 0; i < paths.nr; i++) {
const char *name = paths.items[i].string;
enum finalize_object_file_flags flags_copy = flags;
@@ -274,14 +274,14 @@ int tmp_objdir_migrate(struct tmp_objdir *t)
return 0;
if (t->prev_odb) {
- if (the_repository->objects->odb->will_destroy)
+ if (t->repo->objects->odb->will_destroy)
BUG("migrating an ODB that was marked for destruction");
restore_primary_odb(t->prev_odb, t->path.buf);
t->prev_odb = NULL;
}
strbuf_addbuf(&src, &t->path);
- strbuf_addstr(&dst, repo_get_object_directory(the_repository));
+ strbuf_addstr(&dst, repo_get_object_directory(t->repo));
ret = migrate_paths(&src, &dst, 0);
diff --git a/tmp-objdir.h b/tmp-objdir.h
index 237d96b660..fceda14979 100644
--- a/tmp-objdir.h
+++ b/tmp-objdir.h
@@ -11,7 +11,7 @@
* Example:
*
* struct child_process child = CHILD_PROCESS_INIT;
- * struct tmp_objdir *t = tmp_objdir_create("incoming");
+ * struct tmp_objdir *t = tmp_objdir_create(repo, "incoming");
* strvec_push(&child.args, cmd);
* strvec_pushv(&child.env, tmp_objdir_env(t));
* if (!run_command(&child)) && !tmp_objdir_migrate(t))
@@ -21,13 +21,14 @@
*
*/
+struct repository;
struct tmp_objdir;
/*
* Create a new temporary object directory with the specified prefix;
* returns NULL on failure.
*/
-struct tmp_objdir *tmp_objdir_create(const char *prefix);
+struct tmp_objdir *tmp_objdir_create(struct repository *r, const char *prefix);
/*
* Return a list of environment strings, suitable for use with
diff --git a/trace.c b/trace.c
index d8c43773ae..9b99460db8 100644
--- a/trace.c
+++ b/trace.c
@@ -21,7 +21,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
-#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -297,7 +297,7 @@ static const char *quote_crnl(const char *path)
return new_path.buf;
}
-void trace_repo_setup(void)
+void trace_repo_setup(struct repository *r)
{
const char *git_work_tree, *prefix = startup_info->prefix;
char *cwd;
@@ -307,14 +307,14 @@ void trace_repo_setup(void)
cwd = xgetcwd();
- if (!(git_work_tree = repo_get_work_tree(the_repository)))
+ if (!(git_work_tree = repo_get_work_tree(r)))
git_work_tree = "(null)";
if (!startup_info->prefix)
prefix = "(null)";
- trace_printf_key(&trace_setup_key, "setup: git_dir: %s\n", quote_crnl(repo_get_git_dir(the_repository)));
- trace_printf_key(&trace_setup_key, "setup: git_common_dir: %s\n", quote_crnl(repo_get_common_dir(the_repository)));
+ trace_printf_key(&trace_setup_key, "setup: git_dir: %s\n", quote_crnl(repo_get_git_dir(r)));
+ trace_printf_key(&trace_setup_key, "setup: git_common_dir: %s\n", quote_crnl(repo_get_common_dir(r)));
trace_printf_key(&trace_setup_key, "setup: worktree: %s\n", quote_crnl(git_work_tree));
trace_printf_key(&trace_setup_key, "setup: cwd: %s\n", quote_crnl(cwd));
trace_printf_key(&trace_setup_key, "setup: prefix: %s\n", quote_crnl(prefix));
diff --git a/trace.h b/trace.h
index d304d55aa1..9152fe9b3e 100644
--- a/trace.h
+++ b/trace.h
@@ -92,7 +92,9 @@ extern struct trace_key trace_default_key;
extern struct trace_key trace_perf_key;
extern struct trace_key trace_setup_key;
-void trace_repo_setup(void);
+struct repository;
+
+void trace_repo_setup(struct repository *r);
/**
* Checks whether the trace key is enabled. Used to prevent expensive
diff --git a/trace2.c b/trace2.c
index f894532d05..c23c0a227b 100644
--- a/trace2.c
+++ b/trace2.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "repository.h"
@@ -762,7 +764,7 @@ void trace2_def_param_fl(const char *file, int line, const char *param,
if (!trace2_enabled)
return;
- redacted = redact_arg(value);
+ redacted = value ? redact_arg(value) : NULL;
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_param_fl)
diff --git a/trace2/tr2_sysenv.c b/trace2/tr2_sysenv.c
index 048cdd5438..01379c5cad 100644
--- a/trace2/tr2_sysenv.c
+++ b/trace2/tr2_sysenv.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "dir.h"
diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c
index 45b0850a5e..5a0381791f 100644
--- a/trace2/tr2_tgt_event.c
+++ b/trace2/tr2_tgt_event.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "json-writer.h"
@@ -491,7 +493,8 @@ static void fn_param_fl(const char *file, int line, const char *param,
event_fmt_prepare(event_name, file, line, NULL, &jw);
jw_object_string(&jw, "scope", scope_name);
jw_object_string(&jw, "param", param);
- jw_object_string(&jw, "value", value);
+ if (value)
+ jw_object_string(&jw, "value", value);
jw_end(&jw);
tr2_dst_write_line(&tr2dst_event, &jw.json);
diff --git a/trace2/tr2_tgt_normal.c b/trace2/tr2_tgt_normal.c
index baef48aa69..924736ab36 100644
--- a/trace2/tr2_tgt_normal.c
+++ b/trace2/tr2_tgt_normal.c
@@ -307,8 +307,9 @@ static void fn_param_fl(const char *file, int line, const char *param,
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,
- value);
+ strbuf_addf(&buf_payload, "def_param scope:%s %s", scope_name, param);
+ if (value)
+ strbuf_addf(&buf_payload, "=%s", value);
normal_io_write_fl(file, line, &buf_payload);
strbuf_release(&buf_payload);
}
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index a6f9a8a193..4eb9289f95 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "config.h"
#include "repository.h"
@@ -446,8 +448,9 @@ static void fn_param_fl(const char *file, int line, const char *param,
struct strbuf scope_payload = STRBUF_INIT;
enum config_scope scope = kvi->scope;
const char *scope_name = config_scope_name(scope);
-
- strbuf_addf(&buf_payload, "%s:%s", param, value);
+ strbuf_addstr(&buf_payload, param);
+ if (value)
+ strbuf_addf(&buf_payload, ":%s", value);
strbuf_addf(&scope_payload, "%s:%s", "scope", scope_name);
perf_io_write_fl(file, line, event_name, NULL, NULL, NULL,
diff --git a/trailer.c b/trailer.c
index 46f0e4610b..310cf582dc 100644
--- a/trailer.c
+++ b/trailer.c
@@ -522,7 +522,6 @@ static int git_trailer_config(const char *conf_key, const char *value,
struct conf_info *conf;
char *name = NULL;
enum trailer_info_type type;
- int i;
if (!skip_prefix(conf_key, "trailer.", &trailer_item))
return 0;
@@ -532,7 +531,7 @@ static int git_trailer_config(const char *conf_key, const char *value,
return 0;
variable_name++;
- for (i = 0; i < ARRAY_SIZE(trailer_config_items); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(trailer_config_items); i++) {
if (strcmp(trailer_config_items[i].name, variable_name))
continue;
name = xstrndup(trailer_item, variable_name - trailer_item - 1);
diff --git a/transport-helper.c b/transport-helper.c
index bc27653cde..d457b42550 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -313,9 +313,9 @@ static int string_list_set_helper_option(struct helper_data *data,
struct string_list *list)
{
struct strbuf buf = STRBUF_INIT;
- int i, ret = 0;
+ int ret = 0;
- for (i = 0; i < list->nr; i++) {
+ for (size_t i = 0; i < list->nr; i++) {
strbuf_addf(&buf, "option %s ", name);
quote_c_style(list->items[i].string, &buf, NULL, 0);
strbuf_addch(&buf, '\n');
@@ -333,7 +333,7 @@ static int set_helper_option(struct transport *transport,
{
struct helper_data *data = transport->data;
struct strbuf buf = STRBUF_INIT;
- int i, ret, is_bool = 0;
+ int ret, is_bool = 0;
get_helper(transport);
@@ -344,12 +344,12 @@ static int set_helper_option(struct transport *transport,
return string_list_set_helper_option(data, name,
(struct string_list *)value);
- for (i = 0; i < ARRAY_SIZE(unsupported_options); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(unsupported_options); i++) {
if (!strcmp(name, unsupported_options[i]))
return 1;
}
- for (i = 0; i < ARRAY_SIZE(boolean_options); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(boolean_options); i++) {
if (!strcmp(name, boolean_options[i])) {
is_bool = 1;
break;
@@ -481,7 +481,6 @@ static int get_exporter(struct transport *transport,
{
struct helper_data *data = transport->data;
struct child_process *helper = get_helper(transport);
- int i;
child_process_init(fastexport);
@@ -497,7 +496,7 @@ static int get_exporter(struct transport *transport,
if (data->import_marks)
strvec_pushf(&fastexport->args, "--import-marks=%s", data->import_marks);
- for (i = 0; i < revlist_args->nr; i++)
+ for (size_t i = 0; i < revlist_args->nr; i++)
strvec_push(&fastexport->args, revlist_args->items[i].string);
fastexport->git_cmd = 1;
diff --git a/transport.c b/transport.c
index 47fda6a773..81ae8243b9 100644
--- a/transport.c
+++ b/transport.c
@@ -19,6 +19,7 @@
#include "branch.h"
#include "url.h"
#include "submodule.h"
+#include "strbuf.h"
#include "string-list.h"
#include "oid-array.h"
#include "sigchain.h"
@@ -47,7 +48,6 @@ static int transport_color_config(void)
"color.transport.rejected"
}, *key = "color.transport";
char *value;
- int i;
static int initialized;
if (initialized)
@@ -60,7 +60,7 @@ static int transport_color_config(void)
if (!want_color_stderr(transport_use_color))
return 0;
- for (i = 0; i < ARRAY_SIZE(keys); i++)
+ for (size_t i = 0; i < ARRAY_SIZE(keys); i++)
if (!git_config_get_string(keys[i], &value)) {
if (!value)
return config_error_nonbool(keys[i]);
@@ -153,14 +153,13 @@ static struct ref *get_refs_from_bundle(struct transport *transport,
{
struct bundle_transport_data *data = transport->data;
struct ref *result = NULL;
- int i;
if (for_push)
return NULL;
get_refs_from_bundle_inner(transport);
- for (i = 0; i < data->header.references.nr; i++) {
+ for (size_t i = 0; i < data->header.references.nr; i++) {
struct string_list_item *e = data->header.references.items + i;
const char *name = e->string;
struct ref *ref = alloc_ref(name);
@@ -172,12 +171,29 @@ static struct ref *get_refs_from_bundle(struct transport *transport,
return result;
}
+static int fetch_fsck_config_cb(const char *var, const char *value,
+ const struct config_context *ctx UNUSED, void *cb)
+{
+ struct strbuf *msg_types = cb;
+ int ret;
+
+ ret = fetch_pack_fsck_config(var, value, msg_types);
+ if (ret > 0)
+ return 0;
+
+ return ret;
+}
+
static int fetch_refs_from_bundle(struct transport *transport,
int nr_heads UNUSED,
struct ref **to_fetch UNUSED)
{
+ struct unbundle_opts opts = {
+ .flags = fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0,
+ };
struct bundle_transport_data *data = transport->data;
struct strvec extra_index_pack_args = STRVEC_INIT;
+ struct strbuf msg_types = STRBUF_INIT;
int ret;
if (transport->progress)
@@ -185,12 +201,16 @@ static int fetch_refs_from_bundle(struct transport *transport,
if (!data->get_refs_from_bundle_called)
get_refs_from_bundle_inner(transport);
+
+ git_config(fetch_fsck_config_cb, &msg_types);
+ opts.fsck_msg_types = msg_types.buf;
+
ret = unbundle(the_repository, &data->header, data->fd,
- &extra_index_pack_args,
- fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0);
+ &extra_index_pack_args, &opts);
transport->hash_algo = data->header.hash_algo;
strvec_clear(&extra_index_pack_args);
+ strbuf_release(&msg_types);
return ret;
}
@@ -912,7 +932,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
break;
case protocol_v1:
case protocol_v0:
- ret = send_pack(&args, data->fd, data->conn, remote_refs,
+ ret = send_pack(the_repository, &args, data->fd, data->conn, remote_refs,
&data->extra_have);
break;
case protocol_unknown_version:
@@ -1281,11 +1301,9 @@ void transport_set_verbosity(struct transport *transport, int verbosity,
static void die_with_unpushed_submodules(struct string_list *needs_pushing)
{
- int i;
-
fprintf(stderr, _("The following submodule paths contain changes that can\n"
"not be found on any remote:\n"));
- for (i = 0; i < needs_pushing->nr; i++)
+ for (size_t i = 0; i < needs_pushing->nr; i++)
fprintf(stderr, " %s\n", needs_pushing->items[i].string);
fprintf(stderr, _("\nPlease try\n\n"
" git push --recurse-submodules=on-demand\n\n"
@@ -1601,9 +1619,8 @@ int transport_get_remote_bundle_uri(struct transport *transport)
void transport_unlock_pack(struct transport *transport, unsigned int flags)
{
int in_signal_handler = !!(flags & TRANSPORT_UNLOCK_PACK_IN_SIGNAL_HANDLER);
- int i;
- for (i = 0; i < transport->pack_lockfiles.nr; i++)
+ for (size_t i = 0; i < transport->pack_lockfiles.nr; i++)
if (in_signal_handler)
unlink(transport->pack_lockfiles.items[i].string);
else
diff --git a/tree-diff.c b/tree-diff.c
index 5eab8af631..d9237ffd9b 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -3,6 +3,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "diff.h"
diff --git a/unimplemented.sh b/unimplemented.sh
index fee21d24e8..41776b279d 100644
--- a/unimplemented.sh
+++ b/unimplemented.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-echo >&2 "fatal: git was built without support for $(basename $0) (@@REASON@@)."
+echo >&2 "fatal: git was built without support for $(basename $0) (@REASON@)."
exit 128
diff --git a/unix-socket.c b/unix-socket.c
index 79800d8063..483c9c448c 100644
--- a/unix-socket.c
+++ b/unix-socket.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "strbuf.h"
#include "unix-socket.h"
diff --git a/unpack-trees.c b/unpack-trees.c
index e10a9d1209..334cb84f65 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "advice.h"
@@ -371,7 +372,8 @@ static struct progress *get_progress(struct unpack_trees_options *o,
total++;
}
- return start_delayed_progress(_("Updating files"), total);
+ return start_delayed_progress(the_repository,
+ _("Updating files"), total);
}
static void setup_collided_checkout_detection(struct checkout *state,
@@ -1772,6 +1774,7 @@ static int clear_ce_flags(struct index_state *istate,
strbuf_reset(&prefix);
if (show_progress)
istate->progress = start_delayed_progress(
+ the_repository,
_("Updating index flags"),
istate->cache_nr);
diff --git a/upload-pack.c b/upload-pack.c
index 43006c0614..728b2477fc 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/urlmatch.c b/urlmatch.c
index 1d0254abac..eea8300489 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex-ll.h"
diff --git a/usage.c b/usage.c
index 29a9725784..38b46bbbfe 100644
--- a/usage.c
+++ b/usage.c
@@ -3,11 +3,12 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#include "git-compat-util.h"
#include "gettext.h"
#include "trace2.h"
-static void vreportf(const char *prefix, const char *err, va_list params)
+static void vfreportf(FILE *f, const char *prefix, const char *err, va_list params)
{
char msg[4096];
char *p, *pend = msg + sizeof(msg);
@@ -31,8 +32,13 @@ static void vreportf(const char *prefix, const char *err, va_list params)
}
*(p++) = '\n'; /* we no longer need a NUL */
- fflush(stderr);
- write_in_full(2, msg, p - msg);
+ fflush(f);
+ write_in_full(fileno(f), msg, p - msg);
+}
+
+static void vreportf(const char *prefix, const char *err, va_list params)
+{
+ vfreportf(stderr, prefix, err, params);
}
static NORETURN void usage_builtin(const char *err, va_list params)
@@ -172,6 +178,22 @@ void NORETURN usage(const char *err)
usagef("%s", err);
}
+static void show_usage_if_asked_helper(const char *err, ...)
+{
+ va_list params;
+
+ va_start(params, err);
+ vfreportf(stdout, _("usage: "), err, params);
+ va_end(params);
+ exit(129);
+}
+
+void show_usage_if_asked(int ac, const char **av, const char *err)
+{
+ if (ac == 2 && !strcmp(av[1], "-h"))
+ show_usage_if_asked_helper(err);
+}
+
void NORETURN die(const char *err, ...)
{
va_list params;
@@ -189,7 +211,7 @@ void NORETURN die(const char *err, ...)
static const char *fmt_with_err(char *buf, int n, const char *fmt)
{
char str_error[256], *err;
- int i, j;
+ size_t i, j;
err = strerror(errno);
for (i = j = 0; err[i] && j < sizeof(str_error) - 1; ) {
diff --git a/userdiff.c b/userdiff.c
index d43d8360d1..340c4eb4f7 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
diff --git a/utf8.c b/utf8.c
index 6bfaefa28e..35a0251939 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1,3 +1,5 @@
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "strbuf.h"
#include "utf8.h"
diff --git a/version-def.h.in b/version-def.h.in
new file mode 100644
index 0000000000..347995df06
--- /dev/null
+++ b/version-def.h.in
@@ -0,0 +1,8 @@
+#ifndef VERSION_DEF_H
+#define VERSION_DEF_H
+
+#define GIT_VERSION "@GIT_VERSION@"
+#define GIT_BUILT_FROM_COMMIT "@GIT_BUILT_FROM_COMMIT@"
+#define GIT_USER_AGENT "@GIT_USER_AGENT@"
+
+#endif /* VERSION_DEF_H */
diff --git a/version.c b/version.c
index 41b718c29e..4786c4e0a5 100644
--- a/version.c
+++ b/version.c
@@ -2,6 +2,12 @@
#include "version.h"
#include "strbuf.h"
+#ifndef GIT_VERSION_H
+# include "version-def.h"
+#else
+# include GIT_VERSION_H
+#endif
+
const char git_version_string[] = GIT_VERSION;
const char git_built_from_commit_string[] = GIT_BUILT_FROM_COMMIT;
@@ -24,11 +30,10 @@ const char *git_user_agent_sanitized(void)
if (!agent) {
struct strbuf buf = STRBUF_INIT;
- int i;
strbuf_addstr(&buf, git_user_agent());
strbuf_trim(&buf);
- for (i = 0; i < buf.len; i++) {
+ for (size_t i = 0; i < buf.len; i++) {
if (buf.buf[i] <= 32 || buf.buf[i] >= 127)
buf.buf[i] = '.';
}
diff --git a/versioncmp.c b/versioncmp.c
index e3b2a6e330..b6eebdb989 100644
--- a/versioncmp.c
+++ b/versioncmp.c
@@ -77,11 +77,10 @@ static int swap_prereleases(const char *s1,
int off,
int *diff)
{
- int i;
struct suffix_match match1 = { -1, off, -1 };
struct suffix_match match2 = { -1, off, -1 };
- for (i = 0; i < prereleases->nr; i++) {
+ for (size_t i = 0; i < prereleases->nr; i++) {
const char *suffix = prereleases->items[i].string;
int start, suffix_len = strlen(suffix);
if (suffix_len < off)
diff --git a/walker.c b/walker.c
index 7cc9dbea46..1cf3da0219 100644
--- a/walker.c
+++ b/walker.c
@@ -172,7 +172,8 @@ static int loop(struct walker *walker)
uint64_t nr = 0;
if (walker->get_progress)
- progress = start_delayed_progress(_("Fetching objects"), 0);
+ progress = start_delayed_progress(the_repository,
+ _("Fetching objects"), 0);
while (process_queue) {
struct object *obj = process_queue->item;
diff --git a/worktree.c b/worktree.c
index 77ff484d3e..248bbb39d4 100644
--- a/worktree.c
+++ b/worktree.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "abspath.h"
@@ -111,9 +112,9 @@ struct worktree *get_linked_worktree(const char *id,
strbuf_strip_suffix(&worktree_path, "/.git");
if (!is_absolute_path(worktree_path.buf)) {
- strbuf_strip_suffix(&path, "gitdir");
- strbuf_addbuf(&path, &worktree_path);
- strbuf_realpath_forgiving(&worktree_path, path.buf, 0);
+ strbuf_strip_suffix(&path, "gitdir");
+ strbuf_addbuf(&path, &worktree_path);
+ strbuf_realpath_forgiving(&worktree_path, path.buf, 0);
}
CALLOC_ARRAY(worktree, 1);
@@ -376,32 +377,28 @@ done:
return ret;
}
-void update_worktree_location(struct worktree *wt, const char *path_)
+void update_worktree_location(struct worktree *wt, const char *path_,
+ int use_relative_paths)
{
struct strbuf path = STRBUF_INIT;
- struct strbuf repo = STRBUF_INIT;
- struct strbuf file = STRBUF_INIT;
- struct strbuf tmp = STRBUF_INIT;
+ struct strbuf dotgit = STRBUF_INIT;
+ struct strbuf gitdir = STRBUF_INIT;
if (is_main_worktree(wt))
BUG("can't relocate main worktree");
- strbuf_realpath(&repo, git_common_path("worktrees/%s", wt->id), 1);
+ strbuf_realpath(&gitdir, git_common_path("worktrees/%s/gitdir", wt->id), 1);
strbuf_realpath(&path, path_, 1);
+ strbuf_addf(&dotgit, "%s/.git", path.buf);
if (fspathcmp(wt->path, path.buf)) {
- strbuf_addf(&file, "%s/gitdir", repo.buf);
- write_file(file.buf, "%s/.git", relative_path(path.buf, repo.buf, &tmp));
- strbuf_reset(&file);
- strbuf_addf(&file, "%s/.git", path.buf);
- write_file(file.buf, "gitdir: %s", relative_path(repo.buf, path.buf, &tmp));
+ write_worktree_linking_files(dotgit, gitdir, use_relative_paths);
free(wt->path);
wt->path = strbuf_detach(&path, NULL);
}
strbuf_release(&path);
- strbuf_release(&repo);
- strbuf_release(&file);
- strbuf_release(&tmp);
+ strbuf_release(&dotgit);
+ strbuf_release(&gitdir);
}
int is_worktree_being_rebased(const struct worktree *wt,
@@ -577,12 +574,13 @@ int other_head_refs(each_ref_fn fn, void *cb_data)
* pointing at <repo>/worktrees/<id>.
*/
static void repair_gitfile(struct worktree *wt,
- worktree_repair_fn fn, void *cb_data)
+ worktree_repair_fn fn, void *cb_data,
+ int use_relative_paths)
{
struct strbuf dotgit = STRBUF_INIT;
+ struct strbuf gitdir = STRBUF_INIT;
struct strbuf repo = STRBUF_INIT;
struct strbuf backlink = STRBUF_INIT;
- struct strbuf tmp = STRBUF_INIT;
char *dotgit_contents = NULL;
const char *repair = NULL;
int err;
@@ -598,6 +596,7 @@ static void repair_gitfile(struct worktree *wt,
strbuf_realpath(&repo, git_common_path("worktrees/%s", wt->id), 1);
strbuf_addf(&dotgit, "%s/.git", wt->path);
+ strbuf_addf(&gitdir, "%s/gitdir", repo.buf);
dotgit_contents = xstrdup_or_null(read_gitfile_gently(dotgit.buf, &err));
if (dotgit_contents) {
@@ -615,18 +614,20 @@ static void repair_gitfile(struct worktree *wt,
repair = _(".git file broken");
else if (fspathcmp(backlink.buf, repo.buf))
repair = _(".git file incorrect");
+ else if (use_relative_paths == is_absolute_path(dotgit_contents))
+ repair = _(".git file absolute/relative path mismatch");
if (repair) {
fn(0, wt->path, repair, cb_data);
- write_file(dotgit.buf, "gitdir: %s", relative_path(repo.buf, wt->path, &tmp));
+ write_worktree_linking_files(dotgit, gitdir, use_relative_paths);
}
done:
free(dotgit_contents);
strbuf_release(&repo);
strbuf_release(&dotgit);
+ strbuf_release(&gitdir);
strbuf_release(&backlink);
- strbuf_release(&tmp);
}
static void repair_noop(int iserr UNUSED,
@@ -637,7 +638,7 @@ static void repair_noop(int iserr UNUSED,
/* nothing */
}
-void repair_worktrees(worktree_repair_fn fn, void *cb_data)
+void repair_worktrees(worktree_repair_fn fn, void *cb_data, int use_relative_paths)
{
struct worktree **worktrees = get_worktrees_internal(1);
struct worktree **wt = worktrees + 1; /* +1 skips main worktree */
@@ -645,51 +646,38 @@ void repair_worktrees(worktree_repair_fn fn, void *cb_data)
if (!fn)
fn = repair_noop;
for (; *wt; wt++)
- repair_gitfile(*wt, fn, cb_data);
+ repair_gitfile(*wt, fn, cb_data, use_relative_paths);
free_worktrees(worktrees);
}
void repair_worktree_after_gitdir_move(struct worktree *wt, const char *old_path)
{
- struct strbuf path = STRBUF_INIT;
- struct strbuf repo = STRBUF_INIT;
struct strbuf gitdir = STRBUF_INIT;
struct strbuf dotgit = STRBUF_INIT;
- struct strbuf olddotgit = STRBUF_INIT;
- struct strbuf tmp = STRBUF_INIT;
+ int is_relative_path;
if (is_main_worktree(wt))
goto done;
- strbuf_realpath(&repo, git_common_path("worktrees/%s", wt->id), 1);
- strbuf_addf(&gitdir, "%s/gitdir", repo.buf);
+ strbuf_realpath(&gitdir, git_common_path("worktrees/%s/gitdir", wt->id), 1);
- if (strbuf_read_file(&olddotgit, gitdir.buf, 0) < 0)
+ if (strbuf_read_file(&dotgit, gitdir.buf, 0) < 0)
goto done;
- strbuf_rtrim(&olddotgit);
- if (is_absolute_path(olddotgit.buf)) {
- strbuf_addbuf(&dotgit, &olddotgit);
- } else {
- strbuf_addf(&dotgit, "%s/worktrees/%s/%s", old_path, wt->id, olddotgit.buf);
+ strbuf_rtrim(&dotgit);
+ is_relative_path = ! is_absolute_path(dotgit.buf);
+ if (is_relative_path) {
+ strbuf_insertf(&dotgit, 0, "%s/worktrees/%s/", old_path, wt->id);
strbuf_realpath_forgiving(&dotgit, dotgit.buf, 0);
}
if (!file_exists(dotgit.buf))
goto done;
- strbuf_addbuf(&path, &dotgit);
- strbuf_strip_suffix(&path, "/.git");
-
- write_file(dotgit.buf, "gitdir: %s", relative_path(repo.buf, path.buf, &tmp));
- write_file(gitdir.buf, "%s", relative_path(dotgit.buf, repo.buf, &tmp));
+ write_worktree_linking_files(dotgit, gitdir, is_relative_path);
done:
- strbuf_release(&path);
- strbuf_release(&repo);
strbuf_release(&gitdir);
strbuf_release(&dotgit);
- strbuf_release(&olddotgit);
- strbuf_release(&tmp);
}
void repair_worktrees_after_gitdir_move(const char *old_path)
@@ -725,8 +713,10 @@ static int is_main_worktree_path(const char *path)
* won't know which <repo>/worktrees/<id>/gitdir to repair. However, we may
* be able to infer the gitdir by manually reading /path/to/worktree/.git,
* extracting the <id>, and checking if <repo>/worktrees/<id> exists.
+ *
+ * Returns -1 on failure and strbuf.len on success.
*/
-static int infer_backlink(const char *gitfile, struct strbuf *inferred)
+static ssize_t infer_backlink(const char *gitfile, struct strbuf *inferred)
{
struct strbuf actual = STRBUF_INIT;
const char *id;
@@ -747,12 +737,11 @@ static int infer_backlink(const char *gitfile, struct strbuf *inferred)
goto error;
strbuf_release(&actual);
- return 1;
-
+ return inferred->len;
error:
strbuf_release(&actual);
strbuf_reset(inferred); /* clear invalid path */
- return 0;
+ return -1;
}
/*
@@ -760,16 +749,14 @@ error:
* the worktree's path.
*/
void repair_worktree_at_path(const char *path,
- worktree_repair_fn fn, void *cb_data)
+ worktree_repair_fn fn, void *cb_data,
+ int use_relative_paths)
{
struct strbuf dotgit = STRBUF_INIT;
- struct strbuf realdotgit = STRBUF_INIT;
struct strbuf backlink = STRBUF_INIT;
struct strbuf inferred_backlink = STRBUF_INIT;
struct strbuf gitdir = STRBUF_INIT;
struct strbuf olddotgit = STRBUF_INIT;
- struct strbuf realolddotgit = STRBUF_INIT;
- struct strbuf tmp = STRBUF_INIT;
char *dotgit_contents = NULL;
const char *repair = NULL;
int err;
@@ -781,25 +768,25 @@ void repair_worktree_at_path(const char *path,
goto done;
strbuf_addf(&dotgit, "%s/.git", path);
- if (!strbuf_realpath(&realdotgit, dotgit.buf, 0)) {
+ if (!strbuf_realpath(&dotgit, dotgit.buf, 0)) {
fn(1, path, _("not a valid path"), cb_data);
goto done;
}
- infer_backlink(realdotgit.buf, &inferred_backlink);
+ infer_backlink(dotgit.buf, &inferred_backlink);
strbuf_realpath_forgiving(&inferred_backlink, inferred_backlink.buf, 0);
- dotgit_contents = xstrdup_or_null(read_gitfile_gently(realdotgit.buf, &err));
+ dotgit_contents = xstrdup_or_null(read_gitfile_gently(dotgit.buf, &err));
if (dotgit_contents) {
if (is_absolute_path(dotgit_contents)) {
strbuf_addstr(&backlink, dotgit_contents);
} else {
- strbuf_addbuf(&backlink, &realdotgit);
+ strbuf_addbuf(&backlink, &dotgit);
strbuf_strip_suffix(&backlink, ".git");
strbuf_addstr(&backlink, dotgit_contents);
strbuf_realpath_forgiving(&backlink, backlink.buf, 0);
}
} else if (err == READ_GITFILE_ERR_NOT_A_FILE) {
- fn(1, realdotgit.buf, _("unable to locate repository; .git is not a file"), cb_data);
+ fn(1, dotgit.buf, _("unable to locate repository; .git is not a file"), cb_data);
goto done;
} else if (err == READ_GITFILE_ERR_NOT_A_REPO) {
if (inferred_backlink.len) {
@@ -812,11 +799,11 @@ void repair_worktree_at_path(const char *path,
*/
strbuf_swap(&backlink, &inferred_backlink);
} else {
- fn(1, realdotgit.buf, _("unable to locate repository; .git file does not reference a repository"), cb_data);
+ fn(1, dotgit.buf, _("unable to locate repository; .git file does not reference a repository"), cb_data);
goto done;
}
} else {
- fn(1, realdotgit.buf, _("unable to locate repository; .git file broken"), cb_data);
+ fn(1, dotgit.buf, _("unable to locate repository; .git file broken"), cb_data);
goto done;
}
@@ -838,39 +825,35 @@ void repair_worktree_at_path(const char *path,
* in the "copy" repository. In this case, point the "copy" worktree's
* .git file at the "copy" repository.
*/
- if (inferred_backlink.len && fspathcmp(backlink.buf, inferred_backlink.buf)) {
+ if (inferred_backlink.len && fspathcmp(backlink.buf, inferred_backlink.buf))
strbuf_swap(&backlink, &inferred_backlink);
- }
strbuf_addf(&gitdir, "%s/gitdir", backlink.buf);
if (strbuf_read_file(&olddotgit, gitdir.buf, 0) < 0)
repair = _("gitdir unreadable");
+ else if (use_relative_paths == is_absolute_path(olddotgit.buf))
+ repair = _("gitdir absolute/relative path mismatch");
else {
strbuf_rtrim(&olddotgit);
- if (is_absolute_path(olddotgit.buf)) {
- strbuf_addbuf(&realolddotgit, &olddotgit);
- } else {
- strbuf_addf(&realolddotgit, "%s/%s", backlink.buf, olddotgit.buf);
- strbuf_realpath_forgiving(&realolddotgit, realolddotgit.buf, 0);
+ if (!is_absolute_path(olddotgit.buf)) {
+ strbuf_insertf(&olddotgit, 0, "%s/", backlink.buf);
+ strbuf_realpath_forgiving(&olddotgit, olddotgit.buf, 0);
}
- if (fspathcmp(realolddotgit.buf, realdotgit.buf))
+ if (fspathcmp(olddotgit.buf, dotgit.buf))
repair = _("gitdir incorrect");
}
if (repair) {
fn(0, gitdir.buf, repair, cb_data);
- write_file(gitdir.buf, "%s", relative_path(realdotgit.buf, backlink.buf, &tmp));
+ write_worktree_linking_files(dotgit, gitdir, use_relative_paths);
}
done:
free(dotgit_contents);
strbuf_release(&olddotgit);
- strbuf_release(&realolddotgit);
strbuf_release(&backlink);
strbuf_release(&inferred_backlink);
strbuf_release(&gitdir);
- strbuf_release(&realdotgit);
strbuf_release(&dotgit);
- strbuf_release(&tmp);
}
int should_prune_worktree(const char *id, struct strbuf *reason, char **wtpath, timestamp_t expire)
@@ -1031,3 +1014,38 @@ cleanup:
free(main_worktree_file);
return res;
}
+
+void write_worktree_linking_files(struct strbuf dotgit, struct strbuf gitdir,
+ int use_relative_paths)
+{
+ struct strbuf path = STRBUF_INIT;
+ struct strbuf repo = STRBUF_INIT;
+ struct strbuf tmp = STRBUF_INIT;
+
+ strbuf_addbuf(&path, &dotgit);
+ strbuf_strip_suffix(&path, "/.git");
+ strbuf_realpath(&path, path.buf, 1);
+ strbuf_addbuf(&repo, &gitdir);
+ strbuf_strip_suffix(&repo, "/gitdir");
+ strbuf_realpath(&repo, repo.buf, 1);
+
+ if (use_relative_paths && !the_repository->repository_format_relative_worktrees) {
+ if (upgrade_repository_format(1) < 0)
+ die(_("unable to upgrade repository format to support relative worktrees"));
+ if (git_config_set_gently("extensions.relativeWorktrees", "true"))
+ die(_("unable to set extensions.relativeWorktrees setting"));
+ the_repository->repository_format_relative_worktrees = 1;
+ }
+
+ if (use_relative_paths) {
+ write_file(gitdir.buf, "%s/.git", relative_path(path.buf, repo.buf, &tmp));
+ write_file(dotgit.buf, "gitdir: %s", relative_path(repo.buf, path.buf, &tmp));
+ } else {
+ write_file(gitdir.buf, "%s/.git", path.buf);
+ write_file(dotgit.buf, "gitdir: %s", repo.buf);
+ }
+
+ strbuf_release(&path);
+ strbuf_release(&repo);
+ strbuf_release(&tmp);
+}
diff --git a/worktree.h b/worktree.h
index e961186216..38145df80f 100644
--- a/worktree.h
+++ b/worktree.h
@@ -117,8 +117,8 @@ int validate_worktree(const struct worktree *wt,
/*
* Update worktrees/xxx/gitdir with the new path.
*/
-void update_worktree_location(struct worktree *wt,
- const char *path_);
+void update_worktree_location(struct worktree *wt, const char *path_,
+ int use_relative_paths);
typedef void (* worktree_repair_fn)(int iserr, const char *path,
const char *msg, void *cb_data);
@@ -129,7 +129,7 @@ typedef void (* worktree_repair_fn)(int iserr, const char *path,
* function, if non-NULL, is called with the path of the worktree and a
* description of the repair or error, along with the callback user-data.
*/
-void repair_worktrees(worktree_repair_fn, void *cb_data);
+void repair_worktrees(worktree_repair_fn, void *cb_data, int use_relative_paths);
/*
* Repair the linked worktrees after the gitdir has been moved.
@@ -151,7 +151,8 @@ void repair_worktree_after_gitdir_move(struct worktree *wt, const char *old_path
* worktree and a description of the repair or error, along with the callback
* user-data.
*/
-void repair_worktree_at_path(const char *, worktree_repair_fn, void *cb_data);
+void repair_worktree_at_path(const char *, worktree_repair_fn,
+ void *cb_data, int use_relative_paths);
/*
* Free up the memory for a worktree.
@@ -215,4 +216,17 @@ void strbuf_worktree_ref(const struct worktree *wt,
*/
int init_worktree_config(struct repository *r);
+/**
+ * Write the .git file and gitdir file that links the worktree to the repository.
+ *
+ * The `dotgit` parameter is the path to the worktree's .git file, and `gitdir`
+ * is the path to the repository's `gitdir` file.
+ *
+ * Example
+ * dotgit: "/path/to/foo/.git"
+ * gitdir: "/path/to/repo/worktrees/foo/gitdir"
+ */
+void write_worktree_linking_files(struct strbuf dotgit, struct strbuf gitdir,
+ int use_relative_paths);
+
#endif
diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh
deleted file mode 100644
index 95851b85b6..0000000000
--- a/wrap-for-bin.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-# wrap-for-bin.sh: Template for git executable wrapper scripts
-# to run test suite against sandbox, but with only bindir-installed
-# executables in PATH. The Makefile copies this into various
-# files in bin-wrappers, substituting
-# @@BUILD_DIR@@ and @@PROG@@.
-
-GIT_EXEC_PATH='@@BUILD_DIR@@'
-if test -n "$NO_SET_GIT_TEMPLATE_DIR"
-then
- unset GIT_TEMPLATE_DIR
-else
- GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
- export GIT_TEMPLATE_DIR
-fi
-GITPERLLIB='@@BUILD_DIR@@/perl/build/lib'"${GITPERLLIB:+:$GITPERLLIB}"
-GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
-PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
-
-export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
-
-case "$GIT_DEBUGGER" in
-'')
- exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"
- ;;
-1)
- unset GIT_DEBUGGER
- exec gdb --args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
- ;;
-*)
- GIT_DEBUGGER_ARGS="$GIT_DEBUGGER"
- unset GIT_DEBUGGER
- exec ${GIT_DEBUGGER_ARGS} "${GIT_EXEC_PATH}/@@PROG@@" "$@"
- ;;
-esac
diff --git a/wrapper.c b/wrapper.c
index f87d90bf57..8b98593149 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -1,6 +1,9 @@
/*
* Various trivial helper wrappers around standard functions
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "abspath.h"
#include "parse.h"
@@ -476,7 +479,7 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
for (count = 0; count < TMP_MAX; ++count) {
int i;
uint64_t v;
- if (csprng_bytes(&v, sizeof(v)) < 0)
+ if (csprng_bytes(&v, sizeof(v), 0) < 0)
return error_errno("unable to get random bytes for temporary file");
/* Fill in the random bits. */
@@ -747,7 +750,7 @@ int open_nofollow(const char *path, int flags)
#endif
}
-int csprng_bytes(void *buf, size_t len)
+int csprng_bytes(void *buf, size_t len, MAYBE_UNUSED unsigned flags)
{
#if defined(HAVE_ARC4RANDOM) || defined(HAVE_ARC4RANDOM_LIBBSD)
/* This function never returns an error. */
@@ -782,14 +785,18 @@ int csprng_bytes(void *buf, size_t len)
return -1;
return 0;
#elif defined(HAVE_OPENSSL_CSPRNG)
- int res = RAND_bytes(buf, len);
- if (res == 1)
+ switch (RAND_pseudo_bytes(buf, len)) {
+ case 1:
return 0;
- if (res == -1)
- errno = ENOTSUP;
- else
+ case 0:
+ if (flags & CSPRNG_BYTES_INSECURE)
+ return 0;
errno = EIO;
- return -1;
+ return -1;
+ default:
+ errno = ENOTSUP;
+ return -1;
+ }
#else
ssize_t res;
char *p = buf;
@@ -813,11 +820,11 @@ int csprng_bytes(void *buf, size_t len)
#endif
}
-uint32_t git_rand(void)
+uint32_t git_rand(unsigned flags)
{
uint32_t result;
- if (csprng_bytes(&result, sizeof(result)) < 0)
+ if (csprng_bytes(&result, sizeof(result), flags) < 0)
die(_("unable to get random bytes"));
return result;
diff --git a/wrapper.h b/wrapper.h
index a6b3e1f09e..7df824e34a 100644
--- a/wrapper.h
+++ b/wrapper.h
@@ -127,18 +127,26 @@ int open_nofollow(const char *path, int flags);
void sleep_millisec(int millisec);
+enum {
+ /*
+ * Accept insecure bytes, which some CSPRNG implementations may return
+ * in case the entropy pool has been exhausted.
+ */
+ CSPRNG_BYTES_INSECURE = (1 << 0),
+};
+
/*
* 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.
+ * satisfy the full request is an error. Accepts CSPRNG flags.
*/
-int csprng_bytes(void *buf, size_t len);
+int csprng_bytes(void *buf, size_t len, unsigned flags);
/*
* Returns a random uint32_t, uniformly distributed across all possible
- * values.
+ * values. Accepts CSPRNG flags.
*/
-uint32_t git_rand(void);
+uint32_t git_rand(unsigned flags);
/* Provide log2 of the given `size_t`. */
static inline unsigned log2u(uintmax_t sz)
diff --git a/ws.c b/ws.c
index 9456e2fdbe..70acee3337 100644
--- a/ws.c
+++ b/ws.c
@@ -3,6 +3,9 @@
*
* Copyright (c) 2007 Junio C Hamano
*/
+
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "attr.h"
#include "strbuf.h"
diff --git a/wt-status.c b/wt-status.c
index 6a8c05d1cf..3ee9181764 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "advice.h"
diff --git a/xdiff-interface.c b/xdiff-interface.c
index d5dc88661e..3bd61f26e9 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "gettext.h"
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 344c2dfc3e..4685ba6137 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -19,6 +19,7 @@
* Davide Libenzi <davidel@xmailserver.org>
*
*/
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "xinclude.h"
diff --git a/xdiff/xinclude.h b/xdiff/xinclude.h
index a4285ac0eb..7e56542526 100644
--- a/xdiff/xinclude.h
+++ b/xdiff/xinclude.h
@@ -23,6 +23,8 @@
#if !defined(XINCLUDE_H)
#define XINCLUDE_H
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "xmacros.h"
#include "xdiff.h"